Command Prompt window appears with gui window c++ -
whenever try make c++ gui program/window command prompt window appears window this:
but did this::
#include <iostream> #include "define.h" lresult callback winproc(hwnd hwnd,uint message,wparam wparam,lparam lparam); int winapi winmain(hinstance hinst, hinstance hprevinst, lpstr lpcmdline, int nshowcmd){ window win; msg msg; win.cbclsextra = null; //additional parameters win.cbwndextra = null; //additional parameters win.hbrbackground = (hbrush)color_window ; //sets background color window win.hcursor = loadcursor(null, idc_arrow); //the cursor appear in window win.hicon = null; //icon window win.hinstance = hinst; //handle application instance win.lpszclassname = "window class"; //the unique name of window class win.lpszmenuname = null; //used menus win.style = null; //the , feel of window win.lpfnwndproc=(wndproc)winproc; //the callback procedure (more on later) registerclass(&win); hwnd hwnd = createwindow("window class", "title", ws_overlappedwindow, 200, 200, 640, 480, null, null, hinst, null); showwindow(hwnd, sw_shownormal); while(getmessage(&msg, null, 0, 0)){ translatemessage(&msg); dispatchmessage(&msg); } return 0; } lresult callback winproc(hwnd hwnd,uint message,wparam wparam,lparam lparam){ switch (message){ case wm_create:{ hwnd button = createwindow("button", "ok", ws_visible | ws_child | ws_border, 20, 20, 50, 30, hwnd, null, null, &lparam); break; } case wm_destroy:{ postquitmessage(0); return 0; break; } default:{ return defwindowproc(hwnd, message, wparam, lparam); } } }
i followed code on internet , don't think did wrong want remove annoying cmd window way...
tysm repliers appreciated...........
edit
and btw define.h header file made , define wndclass window
Comments
Post a Comment