STDMETHODIMP CUpgradrToolbar::SetSite(IUnknown *pUnknownSite) { DT(TRACE_I(FS(_T("Toolbar[%08X]: SetSite(%08X)"), this, pUnknownSite))); try { if (!!pUnknownSite) { // attach the window HWND hMyWindow; CComPtr<IUnknown> site(pUnknownSite); CComQIPtr<IOleWindow> window(site); window->GetWindow(&hMyWindow); if (!hMyWindow) { TRACE_E(FS(_T("Toolbar[%08X]: Cannot retrieve toolbar base window"), this)); return E_FAIL; } SubclassWindow(hMyWindow); // get a WebBrowser reference CComQIPtr<IServiceProvider> serviceProvider(site); serviceProvider->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (void**)&m_spWebBrowser); site->QueryInterface(IID_IInputObjectSite, (void**)&m_spSite); // create main window CreateMainWindow(); } } catch (CUpgradrRuntimeError &ex) { HandleError(ex.ErrorMessage()); return E_FAIL; } return S_OK; }
// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { INITCOMMONCONTROLSEX ics; ics.dwSize = sizeof(ics); ics.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&ics); #if !defined(PRODUCT) DebugLogClear(); #endif Settings_Init(); //Joystick_Init(); //Joystick_SelectJoystick(Settings_GetJoystick()); if (!Emulator_Init()) return FALSE; int conf = Settings_GetConfiguration(); //if (conf == 0) //TODO if (!Emulator_InitConfiguration((NeonConfiguration)conf)) return FALSE; Emulator_SetSound(Settings_GetSound()); if (!CreateMainWindow()) return FALSE; return TRUE; }
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { MSG msg = {0}; // Create the Main Window CreateMainWindow(hInstance, iCmdShow); // Initialize Everything! if(!Game::GetInstance()->Initialize(g_hwnd,hInstance)) return E_FAIL; while (WM_QUIT != msg.message) { if(PeekMessage(&msg, g_hwnd, 0, 0, PM_REMOVE)) { TranslateMessage (&msg); DispatchMessage (&msg); } else { Game::GetInstance()->Tick(); } } UnregisterClass( szAppName, wndclassex.hInstance ); return msg.wParam; }
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; /* Application messages are saved here */ hInstance = hInst; hwndMain = CreateMainWindow(); if (!hwndMain) { MessageBox(NULL, "Unable to create window", "pTrans", MB_OK|MB_ICONSTOP); } /* Set the WS_EX_LAYERED style */ SetWindowLong(hwndMain, GWL_EXSTYLE, GetWindowLong(hwndMain, GWL_EXSTYLE) | WS_EX_LAYERED); /* Make the window 60% alpha */ SetLayeredWindowAttributes(hwndMain, 0, (255 * 60) / 100, LWA_ALPHA); /* Show the window */ ShowWindow(hwndMain, nCmdShow); /* Get message from the message queue */ while (GetMessage (&msg, NULL, 0, 0)) { /* Translates virtual key messages to character messages */ TranslateMessage(&msg); /* Sends message to the window proc */ DispatchMessage(&msg); } /* Return value, 0 if WM_QUIT message posted */ return msg.wParam; }
//============================================================================= // Starting point for a Windows application //============================================================================= int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; // Create the main window if (!CreateMainWindow(hInstance, nCmdShow)) return false; for (int i = 0; i<256; i++) // initialize virtual key array vkKeys[i] = false; // main message loop int done = 0; while (!done) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { //look for quit message if (msg.message == WM_QUIT) done = 1; //decode and pass messages on to WinProc TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam; }
/* fonction principale */ int main(int argc,char *argv[]) { Window window; Display *display; Visual *visual; XEvent event; XImage *ximage; GC gc; int process_fils; int depth,done; long event_mask; char buffer; /* creation de la fenetre de l'application */ CreateMainWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Pong"); /* recuperation des variables */ window=GetAppWindow(); display=GetAppDisplay(); /* affichage de la fenetre */ XMapWindow(display,window); while(TRUE) Pong(); return 0; }
//============================================================================= // Starting point for a Windows application // Parameters are: // hInstance - 현재 어플 인스턴스 // hPrevInstance - 항상 NULL, 그냥 구색용 매개변수 // lpCmdLine - pointer to null-terminated string of command line arguments // nCmdShow - specifies how the window is to be shown //============================================================================= int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; // 윈도우 생성 if (!CreateMainWindow(hInstance, nCmdShow)) return false; // 메인 메세지 룹 int done = 0; while (!done) { // PeekMessage is a non-blocking method for checking for Windows messages. if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { // look for quit message if (msg.message == WM_QUIT) done = 1; //메세지 디코딩 TranslateMessage(&msg); // 메세지를 WinProc 콜백으로 전달 DispatchMessage(&msg); } } return msg.wParam; }
int MiniGUIMain (int args, const char* arg[]) { HWND hMainWnd; MSG Msg; MAINWINCREATE CreateInfo; DoSysCmd("date >> CurrentVer"); DoSysCmd("echo \""PROVER"\" >> CurrentVer"); init(); InitCreateInfo (&CreateInfo); hMainWnd = CreateMainWindow (&CreateInfo); if (hMainWnd == HWND_INVALID) return -1; ShowWindow (hMainWnd, SW_SHOWNORMAL); SetCursorPos (805, 605) ; while ( GetMessage (&Msg, hMainWnd) ) { TranslateMessage (&Msg); DispatchMessage (&Msg); } I_DEV_IOBoard_Exit(); MainWindowThreadCleanup (hMainWnd); system_close(); exit(0); return 0; }
//---------------------------------------------------------------------------------------------------------------------- // //---------------------------------------------------------------------------------------------------------------------- void azMain::Run(azIApplication& a_rApplication) { azAssert(s_pMainInstance != NULL, "Static Main instance is not properly set"); CreateMainWindow(); a_rApplication.Initialize(); m_bIsExitRequested = false; MSG oMessage; while (!m_bIsExitRequested) { if (PeekMessage(&oMessage, NULL, 0, 0, PM_REMOVE)) { // Handling Windows messages TranslateMessage(&oMessage); DispatchMessage(&oMessage); } else { // Update scene a_rApplication.Update(); } } a_rApplication.Terminate(); DestroyMainWindow(); }
/************************************************************************ * Ponto inicial para uma aplicacao Windows * Os parametros sao: * hInstance - aponta a instancia da aplicacao * hPrevInstance - sempre NULL parametro ja obsoleto * lpCmdLine - ponteiro para uma string null-terminated contendo os parametros de linha de comando * nCmdShow - determina como a janela deve ser exibida * * Gilson Cavalcanti - [email protected] ************************************************************************/ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; // Verifica se ja existe uma outra instancia desta aplicacao if (OutraInstancia()) return false; // Cria a janela if (!CreateMainWindow(hInstance, nCmdShow)) return false; // Main message loop int done = 0; while (!done) { // Faz um teste sem bloquear a execucao para escutar mensagens do Windows if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { // Se ouviu uma mensagem de quit if (msg.message == WM_QUIT) done = 1; // Decodifica e passa mensagens para o WinProc TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam; }
// // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE /*hInstance*/, int /*nCmdShow*/) { INITCOMMONCONTROLSEX ics; ics.dwSize = sizeof(ics); ics.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&ics); #if !defined(PRODUCT) DebugLogClear(); #endif Settings_Init(); ParseCommandLine(); // Override settings by command-line option if needed if (!Emulator_Init()) return FALSE; WORD conf = (WORD) Settings_GetConfiguration(); if (conf == 0) conf = EMU_CONF_NEMIGA303; if (!Emulator_InitConfiguration(conf)) return FALSE; Emulator_SetSound(Settings_GetSound()); Emulator_SetSpeed(Settings_GetRealSpeed()); if (!CreateMainWindow()) return FALSE; return TRUE; }
C3DConnexion::C3DConnexion(HINSTANCE hInst, HWND hWnd) { HRESULT hr; CComPtr<IUnknown> p3DxDevice; CComPtr<ISimpleDevice> p3DxSimpleDevice; m_ValidFlag = FALSE; m_hParentWnd = hWnd; CreateMainWindow(hInst, 0, 0, 100, 100, "3DConnexion.cpp"); hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); hr = p3DxDevice.CoCreateInstance(__uuidof(Device)); if (SUCCEEDED(hr)) { hr = p3DxDevice.QueryInterface(&p3DxSimpleDevice); if (SUCCEEDED(hr)) { m_3DSensor = p3DxSimpleDevice->Sensor; m_3DKeyboard = p3DxSimpleDevice->Keyboard; p3DxSimpleDevice->LoadPreferences(_T("3DMouse Controller")); p3DxSimpleDevice->Connect(); m_ValidFlag = TRUE; } } }
int CreateCounterDialog(HWND hWnd) { MSG Msg; HWND hcwd; MAINWINCREATE CreateInfo; #ifdef _LITE_VERSION SetDesktopRect(0, 0, 1024, 768); #endif CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.spCaption = MSG_CALCULATION; CreateInfo.hMenu = 0; CreateInfo.hCursor = GetSystemCursor(0); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = CounterDialogProc; CreateInfo.lx = 0; CreateInfo.ty = 0; CreateInfo.rx = 320; CreateInfo.by = 240; CreateInfo.iBkColor = COLOR_lightwhite; CreateInfo.dwAddData = 0; CreateInfo.hHosting = hWnd; hcwd = CreateMainWindow(&CreateInfo); ShowWindow(hcwd, SW_SHOWNORMAL); while (GetMessage(&Msg, hcwd)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } MainWindowThreadCleanup(hcwd); return 0; }
int CreateMainWindowAndReturnExitCodeWhenItCloses( const HINSTANCE i_thisInstanceOfTheProgram, const int i_initialWindowDisplayState ) { // Try to create the main window if ( CreateMainWindow( i_thisInstanceOfTheProgram, i_initialWindowDisplayState ) ) { if (Gameplay::Initialize(s_mainWindow)) { // If the main window was successfully created wait for it to be closed const int exitCode = WaitForMainWindowToCloseAndReturnExitCode(i_thisInstanceOfTheProgram); Gameplay::Shutdown(); return exitCode; } else { //Our game code failed to initialize. Return a made-up error code return -2; } } else { // If the main window wasn't created return a made-up error code return -1; } }
//============================================================================= // Starting point for a Windows application //============================================================================= int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // Check for memory leak if debug build #if defined(DEBUG) | defined(_DEBUG) _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); #endif runtimeLog.open("log.txt"); MSG msg; // Create the game, sets up message handler game = new Grpg; // Create the window if (!CreateMainWindow(hwnd, hInstance, nCmdShow)) return 1; try{ game->initialize(hwnd); // throws GameError // main message loop int done = 0; while (!done) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { // look for quit message if (msg.message == WM_QUIT) done = 1; // decode and pass messages on to WinProc TranslateMessage(&msg); DispatchMessage(&msg); } else game->run(hwnd); // run the game loop } SAFE_DELETE (game); // free memory before exit return msg.wParam; } catch(const GameError &err) { game->deleteAll(); DestroyWindow(hwnd); MessageBox(NULL, err.getMessage(), "Error", MB_OK); } catch(exception e) { game->deleteAll(); DestroyWindow(hwnd); MessageBox(NULL, "Unknown error occured in game.", "Error", MB_OK); } SAFE_DELETE (game); // free memory before exit runtimeLog.close(); return 0; }
void* LightUICreate(FcitxInstance* instance) { FcitxModuleFunctionArg arg; FcitxLightUI* lightui = fcitx_utils_malloc0(sizeof(FcitxLightUI)); FcitxAddon* lightuiaddon = FcitxAddonsGetAddonByName(FcitxInstanceGetAddons(instance), FCITX_LIGHT_UI_NAME); lightui->owner = instance; if (!LoadLightUIConfig(lightui)) { free(lightui); return NULL; } lightui->dpy = InvokeFunction(instance, FCITX_X11, GETDISPLAY, arg); if (lightui->dpy == NULL) { free(lightui); return NULL; } lightui->isfallback = FcitxUIIsFallback(instance, lightuiaddon); lightui->iScreen = DefaultScreen(lightui->dpy); CreateFont(lightui); lightui->protocolAtom = XInternAtom (lightui->dpy, "WM_PROTOCOLS", False); lightui->killAtom = XInternAtom (lightui->dpy, "WM_DELETE_WINDOW", False); /* Main Menu Initial */ FcitxMenuInit(&lightui->mainMenu); FcitxUIMenu **menupp; UT_array* uimenus = FcitxInstanceGetUIMenus(instance); for (menupp = (FcitxUIMenu **) utarray_front(uimenus); menupp != NULL; menupp = (FcitxUIMenu **) utarray_next(uimenus, menupp) ) { FcitxUIMenu * menup = *menupp; if (!menup->isSubMenu) FcitxMenuAddMenuItem(&lightui->mainMenu, menup->name, MENUTYPE_SUBMENU, menup); } FcitxMenuAddMenuItem(&lightui->mainMenu, NULL, MENUTYPE_DIVLINE, NULL); FcitxMenuAddMenuItem(&lightui->mainMenu, _("Configure"), MENUTYPE_SIMPLE, NULL); FcitxMenuAddMenuItem(&lightui->mainMenu, _("Exit"), MENUTYPE_SIMPLE, NULL); lightui->mainMenu.MenuAction = MainMenuAction; lightui->mainMenu.priv = lightui; lightui->mainMenu.mark = -1; lightui->inputWindow = CreateInputWindow(lightui); lightui->mainWindow = CreateMainWindow(lightui); lightui->trayWindow = CreateTrayWindow(lightui); lightui->mainMenuWindow = CreateMainMenuWindow(lightui); FcitxIMEventHook resethk; resethk.arg = lightui; resethk.func = LightUIInputReset; FcitxInstanceRegisterResetInputHook(instance, resethk); return lightui; }
int MiniGUIMain (int argc, const char* argv[]) { MSG Msg; HWND hMainWnd; MAINWINCREATE CreateInfo; #if defined(_LITE_VERSION) && !(_STAND_ALONE) int i; const char* layer =NULL; for (i = 1; i < argc; i++) { if (strcmp (argv[i], "-layer") == 0) { layer = argv[i + 1]; break; } } //GetLayerInfo (layer, NULL, NULL, NULL); if (JoinLayer (layer, argv[0], 0, 0) == INV_LAYER_HANDLE) { printf ("JoinLayer: invalid layer handle.\n"); exit (1); } #endif CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.spCaption = "Palette"; CreateInfo.hMenu = 0; CreateInfo.hCursor = GetSystemCursor(0); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = PaletteWndProc; CreateInfo.lx = 512-SCREEN_W/2; CreateInfo.ty = 384-SCREEN_H/2; CreateInfo.rx = 512+SCREEN_W/2; CreateInfo.by = 384+SCREEN_H/2; CreateInfo.iBkColor = PIXEL_lightwhite; CreateInfo.dwAddData = 0; CreateInfo.hHosting = HWND_DESKTOP; hMainWnd = CreateMainWindow (&CreateInfo); if (hMainWnd == HWND_INVALID) return -1; ShowWindow (hMainWnd, SW_SHOWNORMAL); while (GetMessage(&Msg, hMainWnd)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } MainWindowThreadCleanup (hMainWnd); return 0; }
INT WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE /*hPrevInstance*/, _In_ LPWSTR /*lpCmdLine*/, _In_ INT nCmdShow) { bool bCoInit = false, bMFStartup = false; // Initialize the common controls const INITCOMMONCONTROLSEX icex = { sizeof(INITCOMMONCONTROLSEX), ICC_WIN95_CLASSES }; InitCommonControlsEx(&icex); // Note: The shell common File dialog requires apartment threading. HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (FAILED(hr)) { goto done; } bCoInit = true; hr = MFStartup(MF_VERSION); if (FAILED(hr)) { goto done; } bMFStartup = true; HWND hwnd = CreateMainWindow(hInstance); if (hwnd == 0) { ShowError(NULL, L"CreateMainWindow failed.", hr); goto done; } ShowWindow(hwnd, nCmdShow); // Run the message loop. MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } done: if (FAILED(hr)) { ShowError(NULL, L"Failed to start application", hr); } if (bMFStartup) { MFShutdown(); } if (bCoInit) { CoUninitialize(); } return 0; }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdline, int show) { instance = hInstance; hFont = CreateFont(-17, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana"); hFont2 = CreateFont(-11, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana"); RegisterClasses(); hwndmain = CreateMainWindow(); CreateWindowContent(hwndmain); return MessageLoop(); }
int CreateVerifyModeWindow(HWND hOwner,char *keyvalue) { MAINWINCREATE CreateInfo; printf("%s\n",__FUNCTION__); if (hMainWnd1 != HWND_INVALID) { ShowWindow (hMainWnd1, SW_SHOWNORMAL); return 0; } propin = keyvalue; //hOwner = GetMainWindowHandle (hOwner); //CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION; CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.spCaption = LoadStrByID(HID_SVERIFY); CreateInfo.hMenu = 0; //CreateInfo.hCursor = GetSystemCursor(0); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = Verifywinproc; CreateInfo.lx = 30; CreateInfo.ty = 30; //CreateInfo.rx = g_rcScr.right; //CreateInfo.by = g_rcScr.bottom; CreateInfo.rx = 290; CreateInfo.by = 150; CreateInfo.iBkColor = COLOR_lightgray; CreateInfo.dwAddData = 0; CreateInfo.hHosting = hOwner; temptemp=hOwner; hMainWnd1 = CreateMainWindow(&CreateInfo); //inputhwnd=hMainWnd1; /* hMainWnd1 = CreateMainWindow(&CreateInfo); if (hMainWnd == HWND_INVALID) return -1; ShowWindow(hMainWnd1, SW_SHOWNORMAL); while (GetMessage(&msg,hMainWnd1)) { TranslateMessage(&msg); DispatchMessage(&msg); } MainWindowThreadCleanup(hMainWnd1); if (fpv) return 1; if (pwdv) return 2; return 0; */ return 0; }
//flag=0: Enroll , flag=1: Verify int CreateFaceEnrollWindow(HWND hWnd, int pin) { MSG msg; HWND hMainWnd; MAINWINCREATE CreateInfo; if(0==InitFaceEnroll()) return 0; f_pin=pin; regok=0; SetMenuTimeOut(time(NULL)); ismenutimeout=0; hWnd = GetMainWindowHandle(hWnd); CreateInfo.dwStyle = WS_VISIBLE ; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.spCaption = "Face"; CreateInfo.hMenu = 0; // CreateInfo.hCursor = GetSystemCursor(0); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = FaceEnrollWinProc; CreateInfo.lx = 0; CreateInfo.ty = 0; CreateInfo.rx = g_rcScr.right; CreateInfo.by = g_rcScr.bottom; CreateInfo.iBkColor = 0x00FFA2BE; CreateInfo.dwAddData = 0; CreateInfo.hHosting = hWnd; LoadBitmap(HDC_SCREEN, &fvbg, GetBmpPath("mainmenu.jpg")); LoadBitmap(HDC_SCREEN, &fvbar, GetBmpPath("bar.bmp")); hMainWnd = CreateMainWindow(&CreateInfo); if (hMainWnd == HWND_INVALID) { UnloadBitmap(&fvbg); UnloadBitmap(&fvbar); return 0; } ShowWindow(hMainWnd, SW_SHOWNORMAL); while (GetMessage(&msg, hMainWnd)) { TranslateMessage(&msg); DispatchMessage(&msg); } MainWindowThreadCleanup(hMainWnd); UnloadBitmap(&fvbg); UnloadBitmap(&fvbar); return regok; }
/* --------------------------------------------------------------------- */ int main(int argc, char *argv[]) { int n; Arg args[6]; Initialize(); ProcessArgs(argv); ReadConfigFile(); AutoScale(); if (!Interactive) PrintPS((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL); else { AppShell = XtAppInitialize(&appContext, APP_CLASS, NULL, 0, &argc, argv, fallback_resources, NULL, 0); XtGetApplicationResources(AppShell, (caddr_t) &iv, resources, XtNumber(resources), NULL, 0); n = 0; MainShell = XtCreatePopupShell("topLevelShell", topLevelShellWidgetClass, AppShell, args, n); MainWindow = CreateMainWindow(MainShell); n = 0; ControlShell = XtCreatePopupShell("controlShell", topLevelShellWidgetClass, AppShell, args, n); CreateControlWindow(ControlShell); CreateErrorBox(AppShell); CreateQueryBox(AppShell); CreateWarningBox(AppShell); CreateFileSelectionBox(AppShell); if (NumberDataFiles > 0) NewDataFile((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL); OpenControlWindow(NULL, NULL, NULL); XtManageChild(MainWindow); XtPopup(XtParent(MainWindow), XtGrabNone); if (RealTime) XtAppAddTimeOut(appContext, 1000, UpdateDataRT, NULL); XtAppMainLoop(appContext); } return(0); } /* END MAIN */
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { /* 单实例程序 */ HANDLE hMutex = CreateMutex(NULL, FALSE, SPEEDGEAR_MUTEX); if(ERROR_ALREADY_EXISTS == GetLastError()) { return FALSE; } return CreateMainWindow(hInstance); }
static void qt_thread(void *data) { ui_companion_qt_t *handle = (ui_companion_qt_t*)data; wimp = ctrWimp(0, NULL); if(wimp) { settings_t *settings = config_get_ptr(); GetSettings(wimp, settings); CreateMainWindow(wimp); } }
int net_3gadd(HWND Wnd) { MSG Msg; MAINWINCREATE CreateInfo; HWND MPlayerWnd; PMAINWIN2 pWin; //channing fWnd = Wnd; #if _DEBUG pWin2 = (PMAINWIN2)Wnd; printf ("net_3gadd\n"); printf ("pWin=0x%p \n",pWin2); printf ("fWnd=0x%p \n",fWnd); printf ("pWin->WinType=0x%x\n",pWin2->DataType); printf ("pWin->WinType=0x%x\n",pWin2->WinType); #endif CreateInfo.dwStyle = WS_CAPTION | WS_BORDER | WS_VISIBLE; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.spCaption = MSG_ADD_FILE; CreateInfo.hMenu = 0; CreateInfo.hCursor = GetSystemCursor(IDC_ARROW); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = Desktop; CreateInfo.lx = 0; CreateInfo.ty = 0; CreateInfo.rx = 320; CreateInfo.by = 210; CreateInfo.iBkColor = GetWindowElementColor(BKC_CONTROL_DEF); CreateInfo.dwAddData = 0; CreateInfo.dwReserved = 0; CreateInfo.hHosting = 0; MPlayerWnd = CreateMainWindow(&CreateInfo); if (MPlayerWnd == HWND_INVALID) { return -1; } ShowWindow(MPlayerWnd, SW_SHOWNORMAL); while (GetMessage(&Msg, MPlayerWnd)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } MainWindowThreadCleanup(MPlayerWnd); return 0; }
/////////////////////////////////////////////////////////////////////// // exec /////////////////////////////////////////////////////////////////////// virtual int BeforeExec (QApplication& qApplication, int argc, char** argv, char** env) { int err = 0; if ((m_mainWindow = CreateMainWindow(qApplication, argc, argv, env))) { m_mainWindow->show(); } else { err = 1; } return err; }
void StartWindows( void ) { CreateMainWindow( InstanceHandle ); /* all other windows will be created when Root gets sized */ if( showHow == SW_SHOWNORMAL && RootState == SIZE_MAXIMIZED ) { showHow = SW_SHOWMAXIMIZED; } ShowWindow( Root, showHow ); UpdateWindow( Root ); ShowWindow( EditContainer, SW_SHOWNORMAL ); UpdateWindow( EditContainer ); }
int main(int argc, char* argv[]) { OSStatus err; // Create and show our main window and menubar err = CreateMainWindow(); // Call the event loop RunApplicationEventLoop(); return err; }
int MiniGUIMain (int argc, const char* argv[]) { MSG Msg; HWND hMainWnd; MAINWINCREATE CreateInfo; #ifdef _MGRM_PROCESSES JoinLayer(NAME_DEF_LAYER , "timeeditor" , 0 , 0); #endif #ifdef _LITE_VERSION if (!InitVectorialFonts ()) { printf ("InitVectorialFonts: error.\n"); return 1; } #endif CreateInfo.dwStyle = WS_CAPTION | WS_BORDER | WS_VISIBLE; CreateInfo.dwExStyle = WS_EX_IMECOMPOSE; CreateInfo.spCaption = CAPTION; CreateInfo.hMenu = 0; CreateInfo.hCursor = GetSystemCursor(0); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = TimeEditorWinProc; CreateInfo.lx = 0; CreateInfo.ty = 0; CreateInfo.rx = 240; CreateInfo.by = 320; CreateInfo.iBkColor = PIXEL_lightwhite; CreateInfo.dwAddData = 0; CreateInfo.hHosting = HWND_DESKTOP; hMainWnd = CreateMainWindow (&CreateInfo); if (hMainWnd == HWND_INVALID) return 3; ShowWindow(hMainWnd, SW_SHOWNORMAL); while (GetMessage(&Msg, hMainWnd)) { TranslateMessage(&Msg); DispatchMessage(&Msg); } MainWindowThreadCleanup (hMainWnd); #ifndef _MGRM_THREADS TermVectorialFonts (); #endif return 0; }
/* Our application entry point */ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow) { INITCOMMONCONTROLSEX icc; HWND hWnd; HACCEL hAccelerators; MSG msg; /* Assign global HINSTANCE */ g_hInstance = hInstance; /* Initialise common controls */ icc.dwSize = sizeof(icc); icc.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&icc); /* Register our main window class, or error */ if (!RegisterMainWindowClass()) { MessageBox(NULL, TEXT("Error registering main window class."), TEXT("Error"), MB_ICONERROR | MB_OK); return 0; } /* Create our main window, or error */ if (!(hWnd = CreateMainWindow())) { MessageBox(NULL, TEXT("Error creating main window."), TEXT("Error"), MB_ICONERROR | MB_OK); return 0; } /* Load accelerators */ hAccelerators = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELERATOR)); /* Show main window and force a paint */ ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); /* Main message loop */ while (GetMessage(&msg, NULL, 0, 0) > 0) { if (!TranslateAccelerator(hWnd, hAccelerators, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int)msg.wParam; }