|
WM_DEVICECHANGE
The WM_DEVICECHANGE device message notifies an application of a change to the hardware configuration of a device or the computer.
A window receives this message through its WindowProc function.
HTH
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
But that's not I want. I am not plugging in any devices to watch for WM_DEVICECHANGE message. I just want to force a device manager refresh ( just as we do manually in the control panel-device manager-scan for hardware changes but programatically)
-- modified at 17:46 Tuesday 31st January, 2006
|
|
|
|
|
Yeah, so send it a WM_DEVICECHANGE message - it will catch it and think something has changed, so will refresh.
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"
|
|
|
|
|
Hi!
Here's what I have:
HWND window = GetDlgItem(hDlg, IDC_TREE);
TVINSERTSTRUCT tvInsert;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("Parent");
HTREEITEM hTreeItem = (HTREEITEM)SendMessage(window,TVM_INSERTITEM,0,(LPARAM) (LPTVINSERTSTRUCT) &tvInsert);
SendMessage(window,TVM_INSERTITEM,0,(LPARAM) (LPTVINSERTSTRUCT) &tvInsert);
tvInsert.hParent = hTreeItem;
tvInsert.item.pszText = _T("Child");
SendMessage(window,TVM_INSERTITEM,0,(LPARAM) (LPTVINSERTSTRUCT) &tvInsert);
SendMessage(window,TVM_EXPAND, (WPARAM)(UINT)TVE_EXPAND,(LPARAM) (HTREEITEM) &hTreeItem);
BUuuuut.. the tree doesn't expand for some reason. I've tried collapsing it first then expanding, same thing, it just won't expand.
Kelly Ryan
|
|
|
|
|
KellyR wrote: SendMessage(window,TVM_EXPAND, (WPARAM)(UINT)TVE_EXPAND,(LPARAM) (HTREEITEM) &hTreeItem);
This line is wrong, it should read:
SendMessage(window, TVM_EXPAND, TVE_EXPAND, reinterpret_cast<LPARAM>(hTreeItem));
In particular you have a "&hTreeItem" where you should have just a "hTreeItem". I couldn't resist removing the old style C casts and replacing them with function style casts (which IMHO should be used in practically all new C++ code).
Steve
|
|
|
|
|
Great, that worked, thanks a lot.
Kelly Ryan
|
|
|
|
|
Is there a specific size for the elements in a 2 dimentional array .
I mean can I use an array with this matrix [100][5] or No .
|
|
|
|
|
If I understand your question correctly the answer is yes. All elements in any array are the same size. Accessing a 2 dimensional array as you described is simply a matter of indexing it properly. Assuming you've declared your array as:
int nArray[100][5];
You could assign x to any element in the array with any of the following methods:
<br />
int i, j, x;<br />
<br />
x = nArray[75][4];<br />
for(i=0; i<100; i++)<br />
{<br />
for(j=0; j<5; j++)<br />
{<br />
x = nArray[i][j];<br />
}<br />
}<br />
However, unlike in BASIC you can't access element nArray[100][5]. Array access is always zero relative.
Hope this helps...
-Dethulus
|
|
|
|
|
I have a list control and I want to add functionality to select an item by the key cobination entered similar to windows explorer & outlook. If anyone could point me in the right direction that would be great.
|
|
|
|
|
|
|
I need to gray-out an Edit Box, Pushbutton and Check Box.
I know how to show and hide it with ShowWindow()
GetDlgItem(IDC_BUTT_testupload)->ShowWindow(SW_HIDE);
but how do I gray it out so that it is inactive but
still gray-visible to the User?
VC++ 6.0
Many thanks,
Robert
|
|
|
|
|
GetDlgItem(ID)->EnableWindow(FALSE);
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
Thanks Robert!
Hey, we have the same first and middle name
All the best,
Robert
|
|
|
|
|
|
when someone has already posted the right answer about 10 hours before your come to, please don't do that...
you don't provide anything more.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Thank-you Anil
|
|
|
|
|
LOL when I right click on one file in the Solution Explorer and hit "Compile", it compiles a different file! Then when I build that project, certain modules seem like they are missing... Sometimes it only compiles a single file when I hit Rebuild.
Anyone seen this behaviour?
I think I've found a way around it --- I create a new project and add all those files into it, but it's a real hassle. I imported these projects from VC6, so maybe that's the problem?
thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Hi,
i've included various projects(60) in my workspace and
i've used objectspace-STL within these, since now. I don't know if i have installed
software that damaged the state or something else, but from now i have to set the linker switch "ignore all standard lib.", that it would work - compile and link.
I get following fault, if I don't set it:
: error LNK2001: Nichtaufgeloestes externes Symbol "__declspec(dllimport) public: __thiscall std::_Winit::~_Winit(void)" (__imp_??1_Winit@std@@QAE@XZ)
So I looked for _Winit and find out that my DLL needs msvcp60.dll to work. I know this dll, it's for
MS C++ Runtime Library. But the question is:
How can i use objectspace-stl again and how can i ban this dll ?
Anyone who has experience how could i solve the problem ?
Thanks in advance
Eddy
|
|
|
|
|
Ok, I would guess that HWND is a Handle to a Window and HANDLE is Handle to anything.. but huh, tell me..
|
|
|
|
|
Hi again,
can someone explain the following line to me?
i am also interested in the meaning and sense behine such definition. thanx!
#define SIG_DFL (void (__cdecl *)(int))0
|
|
|
|
|
Ok, I would guess that HWND is a Handle to a Window and HANDLE is Handle to anything.. but huh, tell me..
|
|
|
|
|
I posted this Topic 10 min ago but there seem's something wrong with the forum software. Please delete this Thread. Thanx
|
|
|
|
|
Well that's basically it. An HWND is used to reference API functions that relate to Windows, everything from message processing to device contexts, etc. HWND and HANDLE are not interchangable, although as data types the value of one can certainly be assigned to the other.
The purpose of each is very similar. When you use CreateWindow, the operating system allocates an area that references that Window's characteristics, but essentially puts that area in a "black box", providing access to it through API calls, but not as a direct structure. This gives the writers of the operating system (Microsoft, in this case) the flexibility to change that internal structure any way they want to in the future without impacting the behavior of applications that use it. They only have to change the implementation of the function hooks. Essentially this practice (and other types of handles) was one of the first large-scale implementations of object oriented encapsulation.
Just my thoughts...
-Dethulus
|
|
|
|
|
I can manipulate text and images on a regular device context. When I try, however, to do the same in a memory dc and "blit" it to my display dc all I get is black image.
I am sure it is a simple setting that I am forgeting but I can figure it out, for the life of me.
Any suggestions?
Thanks!
|
|
|
|