这篇教程C++ FindWindowA函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FindWindowA函数的典型用法代码示例。如果您正苦于以下问题:C++ FindWindowA函数的具体用法?C++ FindWindowA怎么用?C++ FindWindowA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FindWindowA函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: notepadHWND notepad(LPCSTR name) { char filename[1024], title[1024]; FILE *f=0x0; sprintf_s(filename, 1024, "%s.txt", name); DWORD rc = fopen_s(&f, filename, "w"); if(rc!=0) { printf("[-] failed to create temporary text file/n"); } fclose(f); HINSTANCE inst = ShellExecuteA(0x0, "open", "notepad.exe", filename, 0x0, SW_SHOW); if(inst < (HINSTANCE)33) { printf("[-] failed to start notepad/n"); } while(1) { sprintf_s(title, 1024, "%s - Notepad", name); HWND hwnd = FindWindowA(0x0, title); if(hwnd) { return hwnd; } sprintf_s(title, 1024, "%s.txt - Notepad", name); hwnd = FindWindowA(0x0, title); if(hwnd) { //printf("[-] failed to retrieve handle to notepad window/n"); //return 0x0; return hwnd; } } return 0x0;}
开发者ID:insecuritea,项目名称:win-kernel-UAFs,代码行数:29,
示例2: CheckWindowCreated/* * Check if Window is onscreen with the appropriate name. * * Windows are not created synchronously. So we do not know * when and if the window will be created/shown on screen. * This function implements a polling mechanism to determine * creation. * A more complicated method would be to use SetWindowsHookEx. * Since polling worked fine in my testing, no reason to implement * the other. Comments about other methods of determining when * window creation happened were not encouraging (not including * SetWindowsHookEx). */static HWND CheckWindowCreated(const char *winName, BOOL closeWindow, int testParams){ HWND window = NULL; int i; /* Poll for Window Creation */ for (i = 0; window == NULL && i < PDDE_POLL_NUM; i++) { Sleep(PDDE_POLL_TIME); /* Specify the window class name to make sure what we find is really an * Explorer window. Explorer used two different window classes so try * both. */ window = FindWindowA("ExplorerWClass", winName); if (!window) window = FindWindowA("CabinetWClass", winName); } ok (window != NULL, "Window /"%s/" was not created in %i seconds - assumed failure.%s/n", winName, PDDE_POLL_NUM*PDDE_POLL_TIME/1000, GetStringFromTestParams(testParams)); /* Close Window as desired. */ if (window != NULL && closeWindow) { SendMessageA(window, WM_SYSCOMMAND, SC_CLOSE, 0); window = NULL; } return window;}
开发者ID:AmesianX,项目名称:wine,代码行数:41,
示例3: mainint main(int argc,char **argv){ argv++; argc--; if (argc!=2) { printf("Wrong number of arguments/r/n"); printf("-g(G) *.ecs or -c *.dat/r/n"); printf("For unknown orders, use -gu(GU) *.ecs or -cu *.dat/r/n"); return 1; } if (strcmp(argv[0],"-g")==0) generate(argv[1]); else if (strcmp(argv[0],"-G")==0) {#ifdef WIN32 ShowWindow(FindWindowA("ConsoleWindowClass",0),SW_HIDE);#endif generate(argv[1]); } else if (strcmp(argv[0],"-c")==0) check(argv[1]); else if (strcmp(argv[0],"-gu")==0) ugenerate(argv[1]); else if (strcmp(argv[0],"-GU")==0) {#ifdef WIN32 ShowWindow(FindWindowA("ConsoleWindowClass",0),SW_HIDE);#endif ugenerate(argv[1]); } else if (strcmp(argv[0],"-cu")==0) ucheck(argv[1]);}
开发者ID:xurubin,项目名称:ParallelCollisionSearch,代码行数:28,
示例4: createWindowsConsolevoid createWindowsConsole() { if(consoleWindow !=0) return; //create a console on Windows so users can see messages //find an available name for our window int console_suffix = 0; char consoleTitle[512]; sprintf(consoleTitle, "%s", "Gource Console"); while(FindWindowA(0, consoleTitle)) { sprintf(consoleTitle, "Gource Console %d", ++console_suffix); } AllocConsole(); SetConsoleTitleA(consoleTitle); //redirect streams to console freopen("conin$", "r", stdin); freopen("conout$","w", stdout); freopen("conout$","w", stderr); consoleWindow = 0; //wait for our console window while(consoleWindow==0) { consoleWindow = FindWindowA(0, consoleTitle); SDL_Delay(100); } //disable the close button so the user cant crash gource HMENU hm = GetSystemMenu(consoleWindow, false); DeleteMenu(hm, SC_CLOSE, MF_BYCOMMAND);}
开发者ID:bitshifter,项目名称:Gource,代码行数:34,
示例5: FindWindowAconst char *LH_Lg160x43::userInit(){#ifdef Q_WS_WIN // make sure neither LCDMon.exe nor LCORE.EXE is running on Windows if( FindWindowA( "Logitech LCD Monitor Window", "LCDMon" ) || FindWindowA( "QWidget", "LCore" ) ) return "Logitech drivers are loaded";#endif scan(); return NULL;}
开发者ID:ProgrammingCube,项目名称:lcdhost,代码行数:11,
示例6: DisableTaskManagerAllUsersButtonvoid DisableTaskManagerAllUsersButton() //Disables the All Users button in Task Manager to prevent convenient killing of the process through the object permission modifications{ // <!-------! CRC AREA START !-------!> char cCheckString[DEFAULT]; sprintf(cCheckString, "%[email C++ FindWindowById函数代码示例 C++ FindWindow函数代码示例
|