Click here to Skip to main content
15,908,173 members
Home / Discussions / C#
   

C#

 
GeneralRe: virtual parameter Pin
S O S7-Apr-03 5:00
S O S7-Apr-03 5:00 
GeneralRe: virtual parameter Pin
Nick Seng7-Apr-03 16:34
Nick Seng7-Apr-03 16:34 
GeneralRe: virtual parameter Pin
S O S7-Apr-03 17:29
S O S7-Apr-03 17:29 
GeneralRe: virtual parameter Pin
Rocky Moore7-Apr-03 5:24
Rocky Moore7-Apr-03 5:24 
QuestionHow to capture Click events from outside the form? Pin
DavidDunning6-Apr-03 21:49
DavidDunning6-Apr-03 21:49 
AnswerRe: How to capture Click events from outside the form? Pin
codepunk7-Apr-03 11:36
codepunk7-Apr-03 11:36 
GeneralCustom Control at Design Time Pin
Itanium6-Apr-03 21:46
Itanium6-Apr-03 21:46 
GeneralA lot of Sockets Pin
nahumtakum6-Apr-03 12:24
nahumtakum6-Apr-03 12:24 
GeneralRe: A lot of Sockets Pin
neroknights7-Apr-03 4:54
neroknights7-Apr-03 4:54 
GeneralRe: A lot of Sockets Pin
nahumtakum7-Apr-03 12:07
nahumtakum7-Apr-03 12:07 
GeneralRe: A lot of Sockets Pin
neroknights8-Apr-03 3:58
neroknights8-Apr-03 3:58 
GeneralRe: A lot of Sockets Pin
nahumtakum8-Apr-03 4:12
nahumtakum8-Apr-03 4:12 
GeneralRe: A lot of Sockets Pin
neroknights8-Apr-03 8:27
neroknights8-Apr-03 8:27 
GeneralRe: A lot of Sockets Pin
nahumtakum9-Apr-03 3:22
nahumtakum9-Apr-03 3:22 
GeneralAccessing Num Lock state from C# Pin
Katalyst6-Apr-03 9:46
Katalyst6-Apr-03 9:46 
GeneralRe: Accessing Num Lock state from C# Pin
Nathan Blomquist7-Apr-03 7:00
Nathan Blomquist7-Apr-03 7:00 
GeneralRe: Accessing Num Lock state from C# Pin
Katalyst7-Apr-03 16:21
Katalyst7-Apr-03 16:21 
Thanks Nathan! That does the trick for getting the num lock state.

I'm trying to figure out how to set the num lock now. I found a Win32 example that does this using keybd_event:

keybd_event(VK_NUMLOCK,
0x45,
KEYEVENTF_EXTENDEDKEY | 0,
0);

The signature of this method is:

VOID keybd_event(
BYTE bVk, // virtual-key code
BYTE bScan, // hardware scan code
DWORD dwFlags, // function options
ULONG_PTR dwExtraInfo // additional keystroke data
);

I wasn't exactly sure what types to use for the last two parameters in the extern statement, so I tried "long" and crossed my fingers:

[DllImport("User32.dll")]
private static extern void keybd_event(byte bVk,
byte bScan,
long dwflags,
long dwExtraInfo);

This actually works the first time I call it, but it gets really flaky after that. I figure that I'm not using the right types for the last two parameters, so I'm stomping on memory somehow. Any clue what types I should use?

Thanks again.
GeneralRe: Accessing Num Lock state from C# Pin
Katalyst7-Apr-03 17:25
Katalyst7-Apr-03 17:25 
GeneralRe: Accessing Num Lock state from C# Pin
Nathan Blomquist7-Apr-03 18:04
Nathan Blomquist7-Apr-03 18:04 
GeneralPictureBox problem Pin
Mazdak6-Apr-03 8:16
Mazdak6-Apr-03 8:16 
GeneralRe: PictureBox problem Pin
James T. Johnson6-Apr-03 8:35
James T. Johnson6-Apr-03 8:35 
GeneralRe: PictureBox problem Pin
Mazdak6-Apr-03 8:51
Mazdak6-Apr-03 8:51 
GeneralIPAddress Problem Pin
Mr BallyDaHob6-Apr-03 5:43
Mr BallyDaHob6-Apr-03 5:43 
GeneralRe: IPAddress Problem Pin
Richard Deeming7-Apr-03 1:43
mveRichard Deeming7-Apr-03 1:43 
GeneralMaking skinned apps. Pin
zamazula6-Apr-03 2:39
zamazula6-Apr-03 2:39 

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.