GUI app and winAPI calls - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7) +---- Thread: GUI app and winAPI calls (/showthread.php?tid=1568) |
RE: GUI app and winAPI calls - mnrvovrfc - 03-24-2023 (03-24-2023, 09:51 AM)aurel Wrote: another bad thing is that message loop is created with DO/LOOP Why is it a bad thing? Just add "DO" in front of "WHILE" statement, and at the bottom write "LOOP" instead of "WEND". "DO/LOOP" exists to give us a loop that could run once. I have never used "WHILE... WEND", it's unnecessary to me. There was the attempt to make it count with "EXIT WHILE" which arrived too late I think, because many programmers resisted so much using "DO... LOOP" instead. In fact, "EXIT DO" was the only way to replicate "break;" statement in C, and the excellent code example in the QB64 Wiki, the only way to "_CONTINUE" until of course that QB64-only statement was invented. The message loop involves "SELECT CASE... END SELECT" also, doesn't it? RE: GUI app and winAPI calls - aurel - 03-24-2023 And that is your main problem? no While GetMessage(msg,0,0,0) <> 0 without "stupid" bRet ..in combination with "stupid" SELECT CASE bRet Main problem is why QB64 not know for type or structure called WNDCLASSEX or why is not recognized when is there ..in mingW header ? RE: GUI app and winAPI calls - aurel - 03-24-2023 This is how typical C++ app should look: #include <windows.h> /* window procedure */ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdParam, int cmdShow) { MSG messages; /* for messages queue manipulation */ WNDCLASSEX WndClass; /* data struct for window class */ HWND hWnd; /* handle for window */ /* define window class */ WndClass.cbSize = sizeof(WNDCLASSEX); WndClass.style = CS_DBLCLKS; WndClass.hInstance = hInst; WndClass.lpszClassName = "WindowClassName"; WndClass.lpfnWndProc = WndProc; /* icons, cursor and menu */ WndClass.hIcon = LoadIcon(hInst, "MAINICON"); /* default icon */ WndClass.hIconSm = LoadIcon(hInst, "MAINICON"); /* default icon */ WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); /* cursor */ WndClass.lpszMenuName = NULL; /* no menu */ WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; /* window background color */ WndClass.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); RegisterClassEx(&WndClass); hWnd = CreateWindowEx(0, /* extended window style */ "WindowClassName", /* registered class */ "Windows Application", /* window title */ WS_OVERLAPPEDWINDOW, /* default window style */ CW_USEDEFAULT, /* x position */ CW_USEDEFAULT, /* y position */ 640, /* width of window */ 480, /* heigth of window */ HWND_DESKTOP, /* The window is a child-window to desktop */ NULL, /* no menu */ hInst, /* Program Instance handler */ NULL); /* No Window Creation data */ ShowWindow(hWnd, SW_SHOW); UpdateWindow(hWnd); /* loop messages. run until GetMessage return 0*/ while (GetMessage(&messages, NULL, 0, 0)) { TranslateMessage(&messages); /* translate virtual keys into character messages*/ DispatchMessage(&messages); /* Send message to WndProc */ } /* return value to system */ return messages.wParam; } /* This function is called by the Windows function DispatchMessage() */ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_DESTROY: PostQuitMessage(0); /* send a WM_QUIT to the message queue */ break; default: /* for messages that we don't deal with */ return DefWindowProc(hwnd, message, wParam, lParam); } return 0; } RE: GUI app and winAPI calls - aurel - 03-25-2023 maybe i lost my mind ..or i am ... I am looking over whole old archived forum and still no clue what i need thanks RhoSigma i just looking into your LARGE framework - really impressive !!! but also very complex (shame on me) it looks that is easier to write native winApi gui program in C++ than in QB64 also it is obvious that new declares are not supported or built in qb64 source code of qb64 is a large 24000 LOC if i find something concrete i will let you know RE: GUI app and winAPI calls - aurel - 03-25-2023 ok i found old topic https://qb64forum.alephc.xyz/index.php?topic=4279.15 RE: GUI app and winAPI calls - aurel - 03-25-2023 Only thing which is not clear to me is this about manifest: Quote:With the release of QB64 v2.0 a seperate manifest nolonger required for Windows controls: So my question is what is $VersionInfo ? RE: GUI app and winAPI calls - RhoSigma - 03-25-2023 (03-25-2023, 09:35 PM)aurel Wrote: Only thing which is not clear to me is this about manifest: Just look into the first 20 lines of source/qb64pe.bas, and the respective Wiki page. RE: GUI app and winAPI calls - aurel - 03-26-2023 Thanks RhoSigma Now ..how i don't know that i must investigate this better RE: GUI app and winAPI calls - RhoSigma - 03-26-2023 (03-26-2023, 07:16 AM)aurel Wrote: Thanks RhoSigma It's basically the informations shown in the File Properties Dialog under the "Details" tab. $VERSIONINFO:FileDescription is also used in Filemanager/Resourcetracking as desciption of the process. |