|
Does anyone know why a c++ mfc exe would run without displaying it's form?
Unfortunately I don't have the source.
|
|
|
|
|
check in the property from Dialog that Visible is ture
|
|
|
|
|
i can't do that as i don't have the source code. I'm sure however that the visible property would be true as the app was built to display a form. It's some sort of environment issue i think.
|
|
|
|
|
So I think in the source code use ShowWindow(0)
|
|
|
|
|
i don't have the source code
|
|
|
|
|
It might be displaying the form off screen. You can use Spy++ to see the properties of the window the process creates and see whether it is visible, and what its position is.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
i didn't know about spy++, thanks for the info!
|
|
|
|
|
Please help.
Im populating the CCombox on OnInitDialog.
How to put color on each item text so when the user click the combobox, it will list the items in color (i.e. half of the list is red and half of the list is blue)
|
|
|
|
|
You have to set the Combobox style to CBS_OWNERDRAW. Then you must draw the Combobox items when the window passes the WM_DRAWITEM message.
|
|
|
|
|
Here[^] is a demo.
Nibu thomas
Software Developer
|
|
|
|
|
First derived from CComboBox
and use WM_DRAWITEM then you should set DC in the combobox
Like this:
void CMyComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItem)
{
CDC dc;
dc.Attach(lpDrawItem->hDC);
....
....
if ((lpDrawItem->itemAction | ODA_SELECT) &&
(lpDrawItem->itemState & ODS_SELECTED))
{
...
...
...
}
else
{
...
...
}
dc.DrawText('item text', -1, &rect, DT_LEFT|DT_SINGLELINE|DT_VCENTER);
dc.Detach();
}
And you can use OnCtlColor in this Class.
|
|
|
|
|
I have been programming windows using C++ since a year, but havent done any UI programming. Now I need to get into UI development, I would like to know of any introductory articles in this area. I have not used MFC before, and would like to stay away from it if possible. Can people suggest any URLs on UI development using C++ that can get me started?
thanks!
|
|
|
|
|
Why don't you try working on SDK.
This is a slow process for developing an application , on the other hand if you use MFC you can speed up application development. You can read the code from this site for developing SDK applications
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
AnShUmAn_VCPP wrote: You can read the code from this site for developing SDK applications
which site?
thanks!
|
|
|
|
|
See the documentation that is available for SDK on codeproject.com.
You will see the option for SDK in the left hand pane when you scroll down on the login page
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
If you right click the CD/DVD-ROM, it will show a menu, and one of its menuitem is "eject". As everyone know that all menuitem have an ID, but after tracing the code, I found that the ID of "eject" can be 31014(normal),
30757(folder view), 47(tree view while using folder mode), 31078(short cut),
102(quick launch view), 38(tree view in the application of winrar), 39(create toolbar on taskbar). And i don't if this menuitem ID have other value. Could somebody help me? How to compute the ID or how many ID are there leave for this menuitem of "eject"??
|
|
|
|
|
What would you like to do with that ID. To eject the CD/DVD drive you have to call functions. The ID is useless because every programm has its own menu-IDs for perhaps similar commands.
|
|
|
|
|
I want to control the flow of eject action! when user click eject, it will get into my code, then i can control it.So i must modify the menuitem, there are two flag can be used, MF_POSITION and MF_COMMAND, it seems that is impossible to get the position of eject, so i choose MF_COMMAND, but i have to get the ID.
|
|
|
|
|
Syouki_kou wrote: when user click eject, it will get into my code
WM_DEVICECHANGE should help you.
Nibu thomas
Software Developer
|
|
|
|
|
It seems to be impossible. How I told you before: every application can use its own ID for the eject command. The usage of a command is hard encoded in its program-code. Therefore its no way to find out which command executes the eject function.
The other post told you about the WM_DEVICECHANGE message - but this is only a notification message broadcasting to all toplevel windows. This message informs all windows that a device has been changed (see Windows-SDK for help).
I've just tested the WM_DEVICECHANGE: the message is called after the media has been removed.
#include <DBT.H><br />
void CFrame::WmDeviceChange(WPARAM w,LPARAM l)<br />
{<br />
switch(w)<br />
{<br />
case DBT_CONFIGCHANGECANCELED:<br />
break;<br />
case DBT_CONFIGCHANGED:<br />
break;<br />
case DBT_DEVICEARRIVAL:<br />
break;<br />
case DBT_DEVICEQUERYREMOVE:<br />
break;<br />
case DBT_DEVICEQUERYREMOVEFAILED:<br />
break;<br />
case DBT_DEVICEREMOVECOMPLETE:<br />
break;<br />
case DBT_DEVICEREMOVEPENDING:<br />
break;<br />
case DBT_DEVICETYPESPECIFIC:<br />
break;<br />
case DBT_USERDEFINED:<br />
break;<br />
default:<br />
TRACE("WmDeviceChange: 0x%04X\r\n",w);<br />
break;<br />
}<br />
}
|
|
|
|
|
Thanks for all of your help!
My code is using shell programming! So all code are handled in this function:
HRESULT CXXXXXXXXX::QueryContextMenu ( HMENU hmenu, UINT uMenuIndex,
UINT uidFirstCmd, UINT uidLastCmd,
UINT uFlags )
I don't know how to associate the upper code with the message WM_DEVICECHANGE, could you help?
|
|
|
|
|
The Code only works if you have a toplevel window. You can create such a window by call:
<br />
LRESULT FAR PASCAL __WndProc(HWND h,int m,WPARAM w,LPARAM l)<br />
{<br />
switch(m)<br />
{<br />
case WM_DEVICECHANGE:<br />
break;<br />
}<br />
return DefWindowProc(h,m,w,l);<br />
}<br />
<br />
void AnyFunction()<br />
{<br />
WNDCLASS wc; memset(&wc,0,sizeof(wc));<br />
HWND hwnd=0;<br />
wc.lpfnWndProc = (WNDPROC)__WndProc; <br />
wc.hInstance = GetModuleHandle(); <br />
wc.lpszClassName = "catchDeviceMsg";<br />
if(RegisterClass(&wc))<br />
hwnd = CreateWindowEx(0,wc.lpszClassName,"",WS_OVERLAPPEDWINDOW,0,0,0,0,0,0,wc.hInstance,0);
}
|
|
|
|
|
Hi all.
I created an MS Windows application working with virtual COM-ports and an MSI-installer for it.
My problem is that you have to install the virtual port (com0com sourceforge-project) by hand using the System->Hardware->"Add new hardware" function. I'd like to find a way to add the "hardware" to the system with my installer with as few user-interaction as possible.
I tried "DPInst" from the MS DFIx framework for installing drivers, but failed. DPInst installed the driver to the system in a PnP-way, making it wait for the hardware to be plugged in (which apparently will never happen
If you install the driver by hand, it works instantly...
Suggestions, anyone?!
Kim
P.S. I'd be happy if someone had some information or sample code on how to use the SetupAPI (SetupDIxxx functions) to install NEW HARDWARE. Maybe that would solve my problem. Looking at the docs it seems like you can only install/update drivers with it...
-- modified at 6:28 Tuesday 28th February, 2006
|
|
|
|
|
I get link error LNK1209 no matter how many times i retry. The .pdb file is there and updated. I've even tried replacing the LINK.EXE, DUMPBIN.EXE, EDITBIN.EXE and LIB.EXE files in the VC98 bin folder (I'm using Visual Studio 6).
dahill
|
|
|
|
|
Did you try doing a "Rebuild All"? Doing that usually fixes things.
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|