Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

Williams

@Williams
About
Posts
17
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to send message to another program?
    W Williams

    Congratulations! Glad to know you! :-D

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    No. try again.

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    Ok. I will try.:)

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    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:

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    you say its ok? I dont understand what do you want. whats is wrong so!?

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    Send me your two tests dialog apps.

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    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.

    C / C++ / MFC tutorial question

  • Background image under solaris.
    W Williams

    I want to put a JPG image as my desktop background. How can I get it.

    System Admin question

  • GetWindowText
    W Williams

    I 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.

    C / C++ / MFC question

  • How to send message to another program?
    W Williams

    Hi, BM_SETCHECK works only to checkbox buttons!! Talk more about your last question!

    C / C++ / MFC tutorial question

  • How to send message to another program?
    W Williams

    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.

    C / C++ / MFC tutorial question

  • CDC::GetTextExtent equivalent in GDI+
    W Williams

    Very thanks!!!;)

    C / C++ / MFC winforms graphics question

  • How to convert CString to char*?
    W Williams

    Hi, Try GetBuffer methode of CString. e.g char *t; CString str = "teste"; t = str.GetBuffer(10); :)

    C / C++ / MFC tutorial question

  • CDC::GetTextExtent equivalent in GDI+
    W Williams

    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:

    C / C++ / MFC winforms graphics question

  • Drawing strings on GDI+ that are vertical bottom to top aligned!
    W Williams

    Very thanks friend. It´s really what I was thinking to do. Thanks for your help!:)

    C / C++ / MFC graphics winforms question

  • Drawing strings on GDI+ that are vertical bottom to top aligned!
    W Williams

    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.

    C / C++ / MFC graphics winforms question

  • GDI+ and MFC
    W Williams

    Hi, 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?

    C / C++ / MFC c++ asp-net winforms graphics question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups