|
i'm looking to find an HWND for a stationary Dialog box
this is what SPY++ gives me
WINDOW: 000004AC
TEXT: ""
CLASS: #32770(Dialog)
STYLE: 50000044
RECT: 6,380)-(598,524) 592x144
THREAD ID: FFFCB805
PROCESS ID: FFFCBFC9
is there anyway i can find the HWND or a CWnd to this dialog box, and veryify it with this
or any way i can get the mainwindow, and follow through, to this dialog?
it doesnt matter if its MFC or winAPI
Just need a way to get to this HWND
any help would be great
regards!
|
|
|
|
|
The Window line (WINDOW:000004AC) is the HWND of the Dialog.
HTH,
Chris
==================
The original message was:
i'm looking to find an HWND for a stationary Dialog box this is what SPY++ gives me
WINDOW: 000004AC TEXT: "" CLASS: #32770(Dialog) STYLE: 50000044 RECT: 6,380)-(598,524) 592x144 THREAD ID: FFFCB805 PROCESS ID: FFFCBFC9
is there anyway i can find the HWND or a CWnd to this dialog box, and veryify it with this or any way i can get the mainwindow, and follow through, to this dialog? it doesnt matter if its MFC or winAPI Just need a way to get to this HWND any help would be great regards!
|
|
|
|
|
I have seen several apps on Win98 that use softshape's
ActiveSkin ActiveX control. Mostly this control allows people
to haev a coherent means for creating skinned 'applications'. It includes
one function that allows you to set a transparency level.
If you download the control right from softshape you can use the
Visual Studio tools to view the interfaces their control provides.
There is an app called BoxCard @ http://softini.cjb.net
that uses this feature and will let you see it in action
I've tried several things briefly to try and implement some transluceny. It
is pretty easy to make a translucent menu or
dialog as long as it is WITHIN a frame window or something. You can
just make owner draw controls that get the parentdc and alphablend the
control DC with the parents. This works really well if you have a
stable bitmap background. However, this become very hard to do when you
have other windows moving around behind a translucent control or
you try to do this on the windows desktop.
Win2K provides a LayeredWindow to help with this. Does anyone have access to
a W2K dev kit that contains this implementation? I check my VC 6 for this
but it does not seem to be included. I'd like to see how they did this.
I also considered it might be possible to control how windows draws the
window, after all - doing this can't befar off from what programs like eFX
and WindowBlinds have been doing to change the frame bars on existing
windows already.
- Eric
Any suggestions? I plan on putting all this info together with some other
controls I've made and putting it up on the web with source. MFc is nice,
but its really easy to think of semi-simple things that are very diffculut
to do - like change an image on a static control (w/o hiding an existing one
and displaying a new control) Anyways, I'm getting off on a tangent. Please
let me know you thoughts or tips.
- Eric
crahen@buffalo.edu
DrCrahen@mad.scientist.com
|
|
|
|
|
I have seen several apps on Win98 that use softshape's
ActiveSkin ActiveX control. Mostly this control allows people
to haev a coherent means for creating skinned 'applications'. It includes
one function that allows you to set a transparency level.
If you download the control right from softshape you can use the
Visual Studio tools to view the interfaces their control provides.
There is an app called BoxCard @ http://softini.cjb.net
that uses this feature and will let you see it in action
I've tried several things briefly to try and implement some transluceny. It
is pretty easy to make a translucent menu or
dialog as long as it is WITHIN a frame window or something. You can
just make owner draw controls that get the parentdc and alphablend the
control DC with the parents. This works really well if you have a
stable bitmap background. However, this become very hard to do when you
have other windows moving around behind a translucent control or
you try to do this on the windows desktop.
Win2K provides a LayeredWindow to help with this. Does anyone have access to
a W2K dev kit that contains this implementation? I check my VC 6 for this
but it does not seem to be included. I'd like to see how they did this.
I also considered it might be possible to control how windows draws the
window, after all - doing this can't befar off from what programs like eFX
and WindowBlinds have been doing to change the frame bars on existing
windows already.
- Eric
Any suggestions? I plan on putting all this info together with some other
controls I've made and putting it up on the web with source. MFc is nice,
but its really easy to think of semi-simple things that are very diffculut
to do - like change an image on a static control (w/o hiding an existing one
and displaying a new control) Anyways, I'm getting off on a tangent. Please
let me know you thoughts or tips.
- Eric
crahen@buffalo.edu
DrCrahen@mad.scientist.com
|
|
|
|
|
I have CWnd* wnd;
And I have CDC* pDC;
How can I draw wnd to pDC?
|
|
|
|
|
Have you tried using CWnd::OnDraw(CDC *pDC)?
==================
The original message was:
I have CWnd* wnd; And I have CDC* pDC;
How can I draw wnd to pDC?
|
|
|
|
|
I've been developing an MFC regular dll which exports a function which creates and displays a dialog. Everytthing works fine. However I get a problem when I
insert an Active -X control (eg: MS-Chart control) at design time and then display the dialog. In this case when I call my exported function the dialog is not displayed at all, and I noticed one thing DoModal returns IDCANCEL.
What do I do to solve this problem.
Thanks, Anyhelp would be highly appreciated.
|
|
|
|
|
Did you call AfxOleInit() and AfxEnableControlContainer() ?
==================
The original message was:
I've been developing an MFC regular dll which exports a function which creates and displays a dialog. Everytthing works fine. However I get a problem when I insert an Active -X control (eg: MS-Chart control) at design time and then display the dialog. In this case when I call my exported function the dialog is not displayed at all, and I noticed one thing DoModal returns IDCANCEL. What do I do to solve this problem. Thanks, Anyhelp would be highly appreciated.
|
|
|
|
|
Actually the client part of the code creates an MFC worker thread which calls my exportred function.
I found a KB article in MSDN which said that I need to call OleInitialize(0) from my client. I did that also, but the dialog is still not displayed. Any ideas ?
Here is the pseudo-code,
UINT Thread Proc(LPVOID )
{
//exported function from regular dll which
//has a dialog with a Registered Active-X control
ShowDlg();
return 0;
}
void CMainFrame::OnViewTest()
{
AfxBeginThread(x,y);
}
The thing works fine if there is no thread involved.
==================
The original message was:
Did you call AfxOleInit() and AfxEnableControlContainer() ? ================== The original message was: I've been developing an MFC regular dll which exports a function which creates and displays a dialog. Everytthing works fine. However I get a problem when I insert an Active -X control (eg: MS-Chart control) at design time and then display the dialog. In this case when I call my exported function the dialog is not displayed at all, and I noticed one thing DoModal returns IDCANCEL. What do I do to solve this problem. Thanks, Anyhelp would be highly appreciated.
|
|
|
|
|
Anyone written a custom button that looks like the "Open" button in the common file open dialog in Word2000? On the right of the button is an arrow that when pressed brings up a menu, however when any other part of the button is pressed the button asks normally.
Thanks
|
|
|
|
|
Hi all,
is it possible in c/c++ to call a function that is created from variables. ..
ex/
CString myFunction
myFunction = "SomeFunction()";
i would like to call the contents of myFunction.
don't know if its possible, any insight appreciated
Brain
|
|
|
|
|
Possible? Sort of kind of - check out Pete Becker's reply to a similar question at:
http://www.cuj.com/archive/1609/qa.html
==================
The original message was:
Hi all,
is it possible in c/c++ to call a function that is created from variables. ..
ex/ CString myFunction
myFunction = "SomeFunction()";
i would like to call the contents of myFunction. don't know if its possible, any insight appreciated
Brain
|
|
|
|
|
==================
The original message was:
Hi all,
is it possible in c/c++ to call a function that is created from variables. ..
ex/ CString myFunction
myFunction = "SomeFunction()";
i would like to call the contents of myFunction. don't know if its possible, any insight appreciated
Brain
Brian:
Yes, this is possible.
The function GetGreater will get the greater of the two values passed in...
int GetGreater ( int, int ) ;
typedef int (*GetGreater) (int, int) ; // this declares a ptr to this function.
Then in the code...
{
PGetGreater pgg;
int maxvalue;
pgg = GetGreater;
if ( pgg )
{
maxvalue = pgg ( 5, 3 ) ;
}
}
Or something like that
Peter.
|
|
|
|
|
Hi, I use contiguous range of command IDs and ON_COMMAND_RANGE() in my app. However, the IDs always be renumbered when I add other resource. This phenomenon drives my crazy. I¡¯d appreciate if someone could tell me how to prevent the renumbering. TIA.
|
|
|
|
|
I have a mapi session (logged on using and existing session), and as such, I have not specified the profile name.
Now that I am logged on, I need to know the name of the profile currently in use.
Any help out there?
|
|
|
|
|
Does anyone have any sample code (or know where some is) to put a tab control on a toolbar. Like the ones in 3D Studio Max, or C++ Builder?
Or, does the article here about adding controls to toolbars work?
Thanks,
Frank
|
|
|
|
|
I have used the class wizard to generate a wrapper class from the type library
of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE
if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding
I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
Hi!
As you've already mentioned you can't use the event map in the late binding. You have to implement the event sink and then use one of the functions below to create a connection between an object's connection point and a client's sink:
CComPtr::Advise(...) - using smart pointers
AtlAdvise(...) - using ATL
IConnectionPoint::Advise(...) - generic interface method
And of course you have to Unadvise when you are done with the object.
Regards,
Alex Gorev,
Dundas Software.
==================
The original message was:
I have used the class wizard to generate a wrapper class from the type library of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
Thanks Alex. I appreciate it.
==================
The original message was:
Hi!
As you've already mentioned you can't use the event map in the late binding. You have to implement the event sink and then use one of the functions below to create a connection between an object's connection point and a client's sink:
CComPtr::Advise(...) - using smart pointers
AtlAdvise(...) - using ATL
IConnectionPoint::Advise(...) - generic interface method
And of course you have to Unadvise when you are done with the object.
Regards, Alex Gorev, Dundas Software.
================== The original message was:
I have used the class wizard to generate a wrapper class from the type library of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
It's me again...
You also can have a look on the very nice article in MSDN:
"HOWTO: Create a Sink Interface in MFC-Based COM Client"
Article ID: Q181845
Alex Gorev,
Dundas Software.
==================
The original message was:
I have used the class wizard to generate a wrapper class from the type library of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
How should I properly close down a child window in an MDI application in OnInitialUpdate()? I've tried using GetParent()->SendMessage( WM_CLOSE ), and WM_DESTROY to no avail. WM_CLOSE doesn't seem to do anything to the window, and WM_DESTROY generates an exception in the MFC framework somewhere. Are there any other suggestions that I might try to get this to work?
|
|
|
|
|
Hi,
I'm just guessing. Have you tried WM_MDIDESTROY instead of WM_DESTROY?
Martin
|
|
|
|
|
Hi,
I have one application that every time that needs to draw calls a thread to do it ( it has a very sllow drawing proccess some graphical sh*ts...).
The problem that I have is..., How can I know what is the invalidated portion ? ( now when I call the thread it repaints all and it's very slow, I would like to know if it is only a portion of a window to redraw...), Is anyway to know this ?
Thanks, Bye !
Braulio
|
|
|
|
|
check out CDC::GetClipBox
Chris
==================
The original message was:
Hi,
I have one application that every time that needs to draw calls a thread to do it ( it has a very sllow drawing proccess some graphical sh*ts...).
The problem that I have is..., How can I know what is the invalidated portion ? ( now when I call the thread it repaints all and it's very slow, I would like to know if it is only a portion of a window to redraw...), Is anyway to know this ?
Thanks, Bye ! Braulio
|
|
|
|
|
Hi, where I can find a GUI toolkit to build graphical GUI like Winamp (non-rectangular dialog, bitmap)
Thanks
|
|
|
|