Click here to Skip to main content
15,924,679 members
Home / Discussions / C#
   

C#

 
GeneralSave database password with crystal report Pin
tomc25-Oct-04 8:56
tomc25-Oct-04 8:56 
GeneralServer.Mappath equivalent in windows application Pin
sunsmile25-Oct-04 6:07
sunsmile25-Oct-04 6:07 
GeneralRe: Server.Mappath equivalent in windows application Pin
Colin Angus Mackay25-Oct-04 6:17
Colin Angus Mackay25-Oct-04 6:17 
GeneralRe: Server.Mappath equivalent in windows application Pin
sunsmile25-Oct-04 8:07
sunsmile25-Oct-04 8:07 
GeneralRe: Server.Mappath equivalent in windows application Pin
Colin Angus Mackay25-Oct-04 10:35
Colin Angus Mackay25-Oct-04 10:35 
GeneralRe: Server.Mappath equivalent in windows application Pin
sunsmile25-Oct-04 11:15
sunsmile25-Oct-04 11:15 
GeneralScrollWindow problem Pin
nasben25-Oct-04 5:12
nasben25-Oct-04 5:12 
QuestionSir,can you help me? Pin
momer25-Oct-04 4:21
momer25-Oct-04 4:21 
when I attach my device to the PC,the case DEVICETYPE.DBT_DEVTYP_DEVICEINTERFACE never occur.What's the trouble?
My code is:
const int WM_DEVICECHANGE = 0x0219;
public enum DEVICETYPE:int
{
DBT_DEVTYP_OEM =0x00000000,// oem-defined device type
DBT_DEVTYP_DEVNODE = 0x00000001, // devnode number
DBT_DEVTYP_VOLUME = 0x00000002, // logical volume
DBT_DEVTYP_PORT = 0x00000003, // serial, parallel
DBT_DEVTYP_NET =0x00000004, // network resource
DBT_DEVTYP_DEVICEINTERFACE =0x00000005 //device interface class
}
//the definition of other structures

protected override void WndProc(ref Message devicemsg)
{
_DEV_BROADCAST_DEVICEINTERFACE
DevBroadcastInterface;
DEVICEEVENT Eventtype;
_DEV_BROADCAST_HDR Whicheventtype;
_DEV_BROADCAST_VOLUME DevBroadcastVolume;

base.WndProc(ref devicemsg);
if(devicemsg.Msg == WM_DEVICECHANGE)
{
Eventtype = (DEVICEEVENT)devicemsg.WParam.ToInt32();
switch(Eventtype)
{
case DEVICEEVENT.DBT_DEVICEARRIVAL:
{
Whicheventtype = (_DEV_BROADCAST_HDR)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_HDR));
switch(Whicheventtype.dbch_devicetype)
{
case DEVICETYPE.DBT_DEVTYP_DEVICEINTERFACE
{//this case can not be retrieved,why?
DevBroadcastInterface = (_DEV_BROADCAST_DEVICEINTERFACE)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_DEVICEINTERFACE));
//do something here.
break;
}
case DEVICETYPE.DBT_DEVTYP_VOLUME:
{// but this case can be retrieved.
DevBroadcastVolume = (_DEV_BROADCAST_VOLUME)Marshal.PtrToStructure(devicemsg.LParam,typeof(_DEV_BROADCAST_VOLUME));
//do something here.
break;
}//end case DBT_DEVTYP_VOLUME
}//end switch(pDevBroadcastHdr.dbch_devicetype)
}//end case DBT_DEVICEARRIVAL
break;
}//end switch(Eventtype)
}//end if
}//end WndProc()

Why does the WndProc can not retrive the DBT_DEVTYP_DEVICEINTERFACE message device type?
Thanks!



GeneralLooking for a control (Multiple-Line Graph) - need help Pin
Anonymous25-Oct-04 3:41
Anonymous25-Oct-04 3:41 
GeneralRe: Looking for a control (Multiple-Line Graph) - need help Pin
Anonymous25-Oct-04 3:47
Anonymous25-Oct-04 3:47 
GeneralCall Graph Pin
DidierD25-Oct-04 3:01
DidierD25-Oct-04 3:01 
GeneralRe: Call Graph Pin
J4amieC25-Oct-04 3:14
J4amieC25-Oct-04 3:14 
GeneralIn DataGrid pressing Enter Pin
Anonymous25-Oct-04 2:32
Anonymous25-Oct-04 2:32 
GeneralHelp In TWain Pin
Member 143728625-Oct-04 2:13
Member 143728625-Oct-04 2:13 
GeneralRe: Help In TWain Pin
Nick Parker25-Oct-04 11:37
protectorNick Parker25-Oct-04 11:37 
Generalprint job copies Pin
jartometienen25-Oct-04 1:11
jartometienen25-Oct-04 1:11 
GeneralRe: print job copies Pin
Duncan Edwards Jones25-Oct-04 1:39
professionalDuncan Edwards Jones25-Oct-04 1:39 
GeneralRe: print job copies Pin
jartometienen25-Oct-04 3:17
jartometienen25-Oct-04 3:17 
GeneralRe: print job copies Pin
Duncan Edwards Jones25-Oct-04 4:33
professionalDuncan Edwards Jones25-Oct-04 4:33 
GeneralRe: print job copies Pin
jartometienen25-Oct-04 22:25
jartometienen25-Oct-04 22:25 
Generaldownload File into local machine Pin
juanito197525-Oct-04 0:36
juanito197525-Oct-04 0:36 
GeneralRe: download File into local machine Pin
Alex Korchemniy25-Oct-04 7:29
Alex Korchemniy25-Oct-04 7:29 
QuestionWhy I cann't get the message device type:DBT_DEVTYP_DEVICEINTERFACE? Pin
momer25-Oct-04 0:16
momer25-Oct-04 0:16 
AnswerRe: Why I cann't get the message device type:DBT_DEVTYP_DEVICEINTERFACE? Pin
WilsonProgramming25-Oct-04 5:56
WilsonProgramming25-Oct-04 5:56 
GeneralRe: Why I cann't get the message device type:DBT_DEVTYP_DEVICEINTERFACE? Pin
momer25-Oct-04 14:51
momer25-Oct-04 14:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.