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

C#

 
GeneralRe: Custom Control OnPaint() Problem(Modified) Pin
Mazdak17-Sep-03 7:48
Mazdak17-Sep-03 7:48 
GeneralRe: Custom Control OnPaint() Problem(Modified) Pin
Douglas Troy17-Sep-03 8:51
Douglas Troy17-Sep-03 8:51 
GeneralSMS via UCP in C# Pin
User 31295917-Sep-03 5:24
User 31295917-Sep-03 5:24 
GeneralSetting Left Margin when printing... Pin
.gonad17-Sep-03 5:04
.gonad17-Sep-03 5:04 
GeneralRe: Setting Left Margin when printing... Pin
.gonad17-Sep-03 5:34
.gonad17-Sep-03 5:34 
QuestionHow to implement a simply textcontrol in a picturebox? Pin
kfowlks17-Sep-03 4:48
kfowlks17-Sep-03 4:48 
Generalpackage and deployment related question Pin
Tridip Bhattacharjee17-Sep-03 4:26
professionalTridip Bhattacharjee17-Sep-03 4:26 
GeneralRe: package and deployment related question Pin
Arun Bhalla18-Sep-03 7:19
Arun Bhalla18-Sep-03 7:19 
GeneralRe: package and deployment related question Pin
sumeat18-Sep-03 15:24
sumeat18-Sep-03 15:24 
GeneralRe: package and deployment related question Pin
Braulio Dez19-Sep-03 2:19
Braulio Dez19-Sep-03 2:19 
Questionhow to loop in control collection?? Pin
Tridip Bhattacharjee17-Sep-03 4:13
professionalTridip Bhattacharjee17-Sep-03 4:13 
AnswerRe: how to loop in control collection?? Pin
Mazdak17-Sep-03 7:53
Mazdak17-Sep-03 7:53 
Questionhow to handle click event for a multiple button ?? Pin
Tridip Bhattacharjee17-Sep-03 4:00
professionalTridip Bhattacharjee17-Sep-03 4:00 
AnswerRe: how to handle click event for a multiple button ?? Pin
MrEyes17-Sep-03 4:28
MrEyes17-Sep-03 4:28 
GeneralWhy disable debug Pin
Old Gun17-Sep-03 3:37
Old Gun17-Sep-03 3:37 
Generalinterop struct types Pin
Tym!17-Sep-03 2:59
Tym!17-Sep-03 2:59 
GeneralMarshaling Structs Reference Pin
Tym!17-Sep-03 4:26
Tym!17-Sep-03 4:26 
GeneralEditable ListView items Pin
Rickard Andersson2017-Sep-03 1:28
Rickard Andersson2017-Sep-03 1:28 
GeneralRe: Editable ListView items Pin
JoeGunchy17-Sep-03 9:22
JoeGunchy17-Sep-03 9:22 
GeneralRe: Editable ListView items Pin
Rickard Andersson2017-Sep-03 10:46
Rickard Andersson2017-Sep-03 10:46 
GeneralWindows service, OnShutDown not executed Pin
EnkelIk16-Sep-03 23:18
EnkelIk16-Sep-03 23:18 
GeneralRe: Windows service, OnShutDown not executed Pin
EnkelIk16-Sep-03 23:36
EnkelIk16-Sep-03 23:36 
GeneralKeyboard hooks - Problem Pin
CyberKewl16-Sep-03 22:21
CyberKewl16-Sep-03 22:21 
I have a problem with keyboard hooks - every time i press hold the CTRL+SHIFT key for quite some time, my application will crash with the error message :

"An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll

Additional information: Object reference not set to an instance of an
object."

I've searched high and low for a solution to this matter but to no avail. Here's the code that i am using, it is meant to disable keys like ALT+TAB, CTRL+ESC, etc:

protected delegate int LowLevelKeyboardProcDelegate(int nCode, int wParam, ref KBDLLHOOKSTRUCT lParam);

[ DllImport( "user32.dll", EntryPoint="SetWindowsHookExA", CharSet=CharSet.Ansi )]

protected static extern int SetWindowsHookEx(int idHook , LowLevelKeyboardProcDelegate lpfn, int hMod , int dwThreadId);

[ DllImport( "user32.dll")]
protected static extern int CallNextHookEx(int hHook,int nCode, int wParam, ref KBDLLHOOKSTRUCT lParam);

[ DllImport("user32.dll")]
protected static extern int UnhookWindowsHookEx(long hhook);

const int WH_KEYBOARD_LL = 13;
public struct KBDLLHOOKSTRUCT
{
public int vkCode;
int scanCode;
public int flags;
int time;
int dwExtraInfo;
}
protected int intLLKey = 0;

protected int LowLevelKeyboardProc(int nCode,int wParam,ref KBDLLHOOKSTRUCT lParam)
{
bool blnEat = false;

switch (wParam)
{
case 256:
case 257:
case 260:
case 261:
//Alt+Tab, Alt+Esc, Ctrl+Esc, Windows Key
if (((lParam.vkCode == 9) && (lParam.flags == 32))
|| ((lParam.vkCode == 27) && (lParam.flags == 32))
|| ((lParam.vkCode == 27) && (lParam.flags == 0))
|| ((lParam.vkCode == 91) && (lParam.flags == 1))
|| ((lParam.vkCode == 92) && (lParam.flags == 1))
|| ((true) && (lParam.flags == 32)))

{
blnEat = true;
}
break;
}
if (blnEat)
return 1;
else
{
return CallNextHookEx(0, nCode, wParam, ref lParam);
}
}
public void KeyboardHook()
{
intLLKey = SetWindowsHookEx(WH_KEYBOARD_LL, new LowLevelKeyboardProcDelegate(LowLevelKeyboardProc), System.Runtime.InteropServices.Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0]).ToInt32(),0);
}

Generalunicode in c# Pin
Anonymous16-Sep-03 21:13
Anonymous16-Sep-03 21:13 
GeneralRe: unicode in c# Pin
Oleksandr Kucherenko17-Sep-03 0:02
Oleksandr Kucherenko17-Sep-03 0:02 

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.