Solved

Use standard SDK function, not MFC

Posted on 2003-11-06
6
418 Views
Last Modified: 2013-11-20
MVC++ 6.0

Alright.  

I am trying to call the function "FindWindow()" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindow.asp).  The problem I'm having is that instead of calling this from the standard Windows SDK, it is using the MFC version, CWnd::FindWindow() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cwnd.3a3a.findwindow.asp) which is useless to me.

I'm having the same problem with SendMessage.  Instead of pulling from the SDK, it's using MFC.

Does anyone know how to tell it to use the standard function and not the MFC version?  Basically I want to use the FindWindow function that returns an HWND, not a CWnd.  Similar issue with SendMessage and many other standard functions that have MFC counterparts.

Thanks.
0
Comment
Question by:Dr_Nick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9699159
Both will give you the same results but one give "CWnd*" but the other HWND. you can convert these 2 into other like

HWND hWnd = pWnd->m_hWnd;

and

CWnd *pWnd = CWnd::FromHandle(hWnd);

Rosh
0
 

Author Comment

by:Dr_Nick
ID: 9699452
Yeah, I know you can cast a CWnd to an HWND, but I still need to know how to use the standard SDK functions.

SendMessage was my other problem.  When I try to use it in VC++ 6, it expects the prototype:

a)  LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );

Because it thinks I mean CWnd::SendMessage(), but I really want the standard SDK function:

b)  LRESULT SendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );

I guess you could simplify my question like this:  I want to use the second SendMessage function (b), but when I try it uses the other one (a).  How can I use function (b) in VC++?

Thanks.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9699456
Ohh yes you have to mentione the global scode symbol

::SendMessage(hWnd, Msg, wParam, lParam); <-----Like this

Good Luck
0
Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

 
LVL 23

Accepted Solution

by:
Roshan Davis earned 150 total points
ID: 9699468
Add "::"  (without quotes) to every function

Good Luck
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9699544
Hi Dr_Nick,
Is that worked?
Rosh :)
0
 

Author Comment

by:Dr_Nick
ID: 9704785
YES!

Thank you very much for your help.  It worked perfectly!

Absolutely perfect.

Nick
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question