Congratulations! Glad to know you! :-D
Williams
Posts
-
How to send message to another program? -
How to send message to another program?No. try again.
-
How to send message to another program?Ok. I will try.:)
-
How to send message to another program?Its really very strange, I didn´t no changes but the path to test dialog.Now I think that there is nothing more to do!:cool:
-
How to send message to another program?you say its ok? I dont understand what do you want. whats is wrong so!?
-
How to send message to another program?Send me your two tests dialog apps.
-
How to send message to another program?Hello, How you get the handle to dialog? did you use the GetWindow methode described in the firts posts? To get the handle to another app(eg your another dialog app) you have to search for window´s caption and compare with your target window´s caption. Once you have the window´s handle you can call GetDlgItem to retrieve a handle to dialog items. I can send you two tests apps that explain it better.
-
Background image under solaris.I want to put a JPG image as my desktop background. How can I get it.
-
GetWindowTextI think the better way is to use SendMessage and OnCopyData. 1. First you search your target window handle. 2. You send a WM_COPYDATA to target window. 3. Write in your target app a function to handlw WM_COPYDATA Code: char szWindowName[60]; // "Target App" is the target app main window caption CString szTargetWindowName = "Target App"; int nFound; int nLength = strlen(szTargetWindowName); HWND hSearchHandle; for(hSearchHandle=::GetWindow(::GetDesktopWindow(), GW_CHILD);hSearchHandle; hSearchHandle = ::GetWindow(hSearchHandle, GW_HWNDNEXT)) { ::GetWindowText(hSearchHandle, szWindowName, 58); szWindowName[nLength] = '\0'; nFound = lstrcmpi(szWindowName, szTargetWindowName); if(nFound == 0) { CWnd pCwnd; COPYDATASTRUCT cds; char myStr[60]; strcpy(myStr,"Lets go."); cds.dwData = 0; cds.lpData = myStr; cds.cbData = sizeof(myStr); LONG lResult; lResult = ::SendMessage(hSearchHandle, WM_COPYDATA,(WPARAM)&pCwnd.m_hWnd, (LPARAM)(COPYDATASTRUCT*)&cds); } } ----------------------------------------- Now in your target app: BOOL CAppADlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) { MessageBox((char *)pCopyDataStruct->lpData); return CDialog::OnCopyData(pWnd, pCopyDataStruct); } Try it.
-
How to send message to another program?Hi, BM_SETCHECK works only to checkbox buttons!! Talk more about your last question!
-
How to send message to another program?Heare are the steps and code to send messages to another program. 1. Remember that on Windows all are windows, so you need to get a HWND to your target window. 2. With the target HWND you call GetDlgItem to retrieve a handlw to window control. 3. Send the message to the window´s control directly. code: // buffer to get the target caption window returned by // GetWindowText char szWindowName[60]; CString szTargetWindowName = "MyApp"; // Target window int nFound; int nLength = strlen(szTargetWindowName); HWND hSearchHandle; //Search around our "MyApp" for(hSearchHandle=::GetWindow(::GetDesktopWindow(),GW_CHILD);hSearchHandle; hSearchHandle = ::GetWindow(hSearchHandle, GW_HWNDNEXT)) { ::GetWindowText(hSearchHandle, szWindowName, 20); szWindowName[nLength] = '\0'; nFound = lstrcmpi(szWindowName,szTargetWindowName); if(nFound == 0) { CWnd pCwnd; // WPARAM 1: Check, 0: uncheck ::SendMessage(::GetDlgItem(hSearchHandle,, BM_SETCHECK,1,0); } } if you have any problem with the code above contact me . Asta la vista.
-
CDC::GetTextExtent equivalent in GDI+Very thanks!!!;)
-
How to convert CString to char*?Hi, Try GetBuffer methode of CString. e.g char *t; CString str = "teste"; t = str.GetBuffer(10); :)
-
CDC::GetTextExtent equivalent in GDI+Hi, Can someone tell me how can I get the width of a text to one determined font, cause I want to draw a rectangle that just fit around the text.:cool:
-
Drawing strings on GDI+ that are vertical bottom to top aligned!Very thanks friend. It´s really what I was thinking to do. Thanks for your help!:)
-
Drawing strings on GDI+ that are vertical bottom to top aligned!Hi, How can I draw strings with GDI+ that are are vertical bottom to top aligned! I try things as SetFormat(StringFormatFlagsDirectionVertical | StringFormatFlagsDirectionRightToLeft) but the text is always top to bottom oriented.
-
GDI+ and MFCHi, I would like to play with GDI+ but I don't have time to download the core SDK, I need just GDI+ files. what can I do. does anyone have these files where I can download it? One more thing. How I can use GDI+ in MFC apps?