Original Post
Hello everyone,
I'm having a problem that when i create a window as a dialog using a resource (CreateDialog (...)), all other windows can be activated, for example, if i use MessageBox (...), the box shows up but i can't click it, when i hover over a button in it, it glows, but i can click it, same with combo boxes, when i click the arrow to show a list, then i can't click anything in the list, nor the main dialog, why does this happen?
here's some source
what am i doing wrong?
my other question is, how can i get fonts on system? i tried this:
but it shows a very huge list of fonts, and alot of repeated fonts, plus some of them with names starting with '@', how can i make it give non-repeated fonts, and get rid of those '@' ones? (do i have to check it myself? on msdn:<> how is it showing multiple repeated names then?)
thanks in advance
regards
-Hassan
I'm having a problem that when i create a window as a dialog using a resource (CreateDialog (...)), all other windows can be activated, for example, if i use MessageBox (...), the box shows up but i can't click it, when i hover over a button in it, it glows, but i can click it, same with combo boxes, when i click the arrow to show a list, then i can't click anything in the list, nor the main dialog, why does this happen?
here's some source
//resourceID_DLG DIALOGEX 50, 50, 340, 330STYLE WS_VISIBLE | WS_CAPTION | WS_BORDERFONT 8, "MS Shell Dlg", 400, 0, 0x1BEGIN//....//....END//creation wnd = CreateDialogA ( hInstance, MAKEINTRESOURCEA ( ID_DLG ), NULL, (DLGPROC)Proc ); SetWindowTextA ( wnd, "Client Configurations" ); SetWindowLongA ( wnd, GWL_STYLE, GetWindowLongA ( wnd, GWL_STYLE ) &~ WS_MAXIMIZEBOX );//loop MSG msg; while ( GetMessageA ( &msg, wnd, 0, 0 ) > 0 ) { TranslateMessage ( &msg ); DispatchMessageA ( &msg );//....updates... }//procedureLRESULT CALLBACK Proc ( HWND wnd, UINT msg, WPARAM w, LPARAM l ){ switch ( msg ) {//....cases.... default: return DefWindowProcA ( wnd, msg, w, l ); } return TRUE;}what am i doing wrong?
my other question is, how can i get fonts on system? i tried this:
LOGFONTA f = { 0 }; f.lfCharSet = DEFAULT_CHARSET; strcpy ( f.lfFaceName, "" ); f.lfPitchAndFamily = 0; EnumFontFamiliesExA ( GetDC ( wnd ), &f, (FONTENUMPROCA)fontProc, 0, 0 );//procedureint CALLBACK fontProc ( const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam ){ if ( FontType & TRUETYPE_FONTTYPE ) { SendDlgItemMessageA ( wnd, ID_NS_FONTS, CB_ADDSTRING, 0, (LPARAM)lpelfe->lfFaceName ); int x = 0; } return 1;}but it shows a very huge list of fonts, and alot of repeated fonts, plus some of them with names starting with '@', how can i make it give non-repeated fonts, and get rid of those '@' ones? (do i have to check it myself? on msdn:<
thanks in advance
regards
-Hassan