一年·几件事
公元二零零六年的第三百六十五天。公司发善心,提前下了班。 早 […]
公元二零零六年的第三百六十五天。公司发善心,提前下了班。 早 […]
又逢岁末,天降瑞雪。老汉午间与楼梯口处俯视四周,白茫茫一片, […]
暖气果然不是白烧的,虽说一天二十多个字,气表转动的和螺旋桨似 […]
凭着老汉的运气和糖衣的赞助,周六傍晚在五道口工人俱乐部看了《 […]
一个朋友跳了槽,和原先比起来,算是当了准自由人。新公司里的两 […]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
// // Integrated browser mode - package up a bunch of data into a COPYDATASTRUCT, // and send it to the desktop window via SendMessage(WM_COPYDATA). // void LaunchInternetExplorerWithoutProcess() { #define MAX_IEEVENTNAME 32 // First piece of data is a wide string version of the command line. WCHAR wsz[MAX_IEEVENTNAME] = L""; COPYDATASTRUCT cds = { SW_NORMAL, sizeof(WCHAR), wsz }; // Second piece of data is the event to fire when the browser window reaches WM_CREATE. static DWORD dwNextId = 0; TCHAR szEvent[MAX_IEEVENTNAME + 1]; wsprintf(szEvent, TEXT("IE-%08X-%08X"), GetCurrentThreadId(), dwNextId++); HANDLE hEventReady = CreateEvent(NULL, FALSE, FALSE, szEvent); if(hEventReady) { // Put the (UNICODE) event name at the end of the cds data LPWSTR pwszEvent = &wsz[1]; #ifdef UNICODE lstrcpy(pwszEvent, szEvent); #else MultiByteToWideChar(CP_ACP, 0, szEvent, -1, pwszEvent, sizeof(szEvent) / sizeof(szEvent[0])); #endif cds.cbData += (lstrlenW(pwszEvent) + 1) * sizeof(WCHAR); // Send the message HWND hwndDesktop = GetShellWindow(); int iRet = (int)SendMessage(hwndDesktop, WM_COPYDATA, (WPARAM)hwndDesktop, (LPARAM)&cds); if(iRet) { // Wait for the browser window to hit WM_CREATE. // When this happens, all DDE servers will have been registered. DWORD dwRet = WaitForSingleObject(hEventReady, 1000 * 10); // 10 seconds #ifdef ASSERT ASSERT(dwRet == WAIT_OBJECT_0); #endif // ASSERT } CloseHandle(hEventReady); } #undef MAX_IEEVENTNAME } |
据说现在中国电影导演界有三个巨头,一为张艺谋,二为冯小刚,三 […]
小牛开玩笑,鼓动老汉出书,书名他都帮我想好了,叫《月子》。这 […]
1、《老舍文萃》,文化艺术出版社 2、《话说鲁迅 —— 赵延 […]
老汉好像是个先知后觉的人。 今天早上突然来了个兴致,决定去看 […]