and with message WM_COMMAND and switch (LOWORD(wParam)) ? Why could if( hWndChild != GetDlgItem(hWnd, IDOK) ) be needed if the second one checks for a window in focus? With this switch i get a notification even if user clicks on the editbox. Is it possible to check HIWORD(wParam) for a mouseclick when the control is an editbox? Do i have to use ES_MULTILINE | ES_WANTRETURN flags when creating the editbox in order to make the control even receive a notification about Enter? Unfortunately i see no changes after adding these flags.. WinInf.EditBox = CreateWindow ("edit", "", WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NOHIDESEL | ES_MULTILINE | ES_WANTRETURN, WinInf.ClientRect.left + 2, WinInf.ClientRect.bottom - 20, WinInf.ClientRect.right - 4, 20, hwnd, (HMENU) 1, WinInf.hInst, NULL);
All suggestions are welcome, Thank You..
IndrekSnt
Posts
-
EditBox & Enter -
EditBox & EnterThank You.. Seems that i posted it into a wrong discussion board.. :( Win32 API without MFC would be a bit more helpful for me as i'm using DevC++ and i don't know what equals to CDialog::OnOK(); All suggestions are welcome, Thank You..
-
EditBox & EnterHello, could it be possible to get a notification message when user presses Enter with the Editbox selected. If user hits Enter, it should get the editbox's text and write it into a Textbox.. All suggestions are welcome, Thank You..
-
long!=long? //RECT problemHmm, thanks, it helped me out... :) --- Blääh
-
long!=long? //RECT problemRECT rect; LPCRECT rect2; AfxGetApp()->GetMainWnd()->GetClientRect(&rect); rect2->left=rect.left; rect2->right=rect.right; rect2->top=rect.top; rect2->bottom=rect.bottom/6; cdc->FillRect(rect2,cb); :wtf::confused: Why isn't this thing working? I know no other way of copying rects. Any suggestions are welcome. --- Blääh
-
MFC multiple documents?Hmm, I started a MFC MDI project but I don't know how to customise it more than MFC MDI wizard allows... --- Earth is like an apple, where are worms in it - the worms are humans...
-
MFC multiple documents?BOOL CGLprMpDoc::OnNewDocument() { if (!CDocument::OnNewDocument()) return FALSE; // TODO: add reinitialization code here // (SDI documents will reuse this document) return TRUE; }
What do I have to write between lines:// (SDI documents will reuse this document)
and:return TRUE;
--- Earth is like an apple, where are worms in it - the worms are humans... -
MFC multiple documents?I have a MFC program which supports Documents but I want my program to start with multiple documents. How could it be possible? Earth is like an apple, where are worms in it - the worms are humans...
-
RAM project:-D Thanks, it really helped me out, now i'm executing MSPAINT and NOTEPAD to terminate them... :)
-
RAM projectI'm not copying all my code but the InsertItem() functions are here:
proc=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); info=new PROCESSENTRY32; info->dwSize=sizeof(PROCESSENTRY32); int id=0; Process32First(proc,info); m_list1.InsertItem(0,(LPCTSTR)info->szExeFile); while(Process32Next(proc,info)!=FALSE){ id++; m_list1.InsertItem(id,(LPCTSTR)info->szExeFile); } CloseHandle(proc);
This here was too only a segment of the code... :omg: -
RAM projectHANDLE proc; PROCESSENTRY32* info; POSITION p; int sel=0; BOOL result; char *name2; int length=0; proc=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); info=new PROCESSENTRY32; info->dwSize=sizeof(PROCESSENTRY32); int id=0; Process32First(proc,info); p=m_list1.GetFirstSelectedItemPosition(); sel=m_list1.GetNextSelectedItem(p); do{ Process32Next(proc,info); }while(!strstr(info->szExeFile,"NOTEPAD")); proc=OpenProcess(/*PROCESS_ALL_ACCESS*/SYNCHRONIZE|PROCESS_TERMINATE,TRUE,info->th32ProcessID); m_name.Format("%s",info->szExeFile); SetDlgItemText(IDC_NAME,m_name.GetBuffer(0)); if(WaitForSingleObject(proc,5000)!=WAIT_OBJECT_0){ result=TerminateProcess(proc,0); MessageBox("Terminated","OK"); }else{ result=TRUE; cw=FindWindow(info->szExeFile,NULL); cw->PostMessage(WM_CLOSE); MessageBox("TRUE","VIGA"); } CloseHandle(proc); delete info;
Well, this should work, but how to use m_mylist.GetItemText(int nItem,intnSubItem,LPTSTR lpszText,innLen) with my code? :confused: -
RAM projectI'm really sorry about the mess above cause i got something... :)
-
RAM projectI know that, ok, my code that doesn't work:
PROCESSENTRY32* info; HANDLE proc2; Process32First(proc2,info); for(int i=0;i<35;i++){ Process32Next(proc2,info); MessageBox(info->szExeFile,"OK"); if(strstr("NOTEPAD",info->szExeFile)){MessageBox("MATCH","OK");break;} } proc2=OpenProcess(/*PROCESS_ALL_ACCESS*/SYNCHRONIZE|PROCESS_TERMINATE,TRUE,1241980); m_name.Format("%d",info->th32ProcessID); SetDlgItemText(IDC_NAME,m_name.GetBuffer(0)); if(WaitForSingleObject(proc2,5000)!=WAIT_OBJECT_0){ result=TerminateProcess(proc2,0); MessageBox("Terminated","OK"); }else{ result=TRUE; cw=FindWindow(info->szExeFile,NULL); cw->PostMessage(WM_CLOSE); MessageBox("TRUE","VIGA"); } // if(!TerminateProcess(proc2,1)){ // } CloseHandle(proc2);
Well, it's only for testing... Such a mess for testing :rolleyes: -
RAM projectI want to finish a program that terminates proccesses that are selected in a big list. And my program must run always @ startup. How to terminate proccesses correctly selected in list? :wtf: My eyes - fountains of blood