Click here to Skip to main content
15,911,132 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to determine the Type of a null-Reference ? Pin
DaveyM6914-Oct-08 0:51
professionalDaveyM6914-Oct-08 0:51 
GeneralRe: How to determine the Type of a null-Reference ? Pin
MarkPhB14-Oct-08 0:18
MarkPhB14-Oct-08 0:18 
AnswerRe: How to determine the Type of a null-Reference ? Pin
Simon P Stevens14-Oct-08 0:39
Simon P Stevens14-Oct-08 0:39 
GeneralRe: How to determine the Type of a null-Reference ? Pin
Mark Churchill14-Oct-08 2:35
Mark Churchill14-Oct-08 2:35 
GeneralRe: How to determine the Type of a null-Reference ? Pin
Simon P Stevens14-Oct-08 2:50
Simon P Stevens14-Oct-08 2:50 
GeneralRe: How to determine the Type of a null-Reference ? Pin
Mark Churchill14-Oct-08 2:57
Mark Churchill14-Oct-08 2:57 
AnswerRe: How to determine the Type of a null-Reference ? Pin
Scott Dorman14-Oct-08 8:23
professionalScott Dorman14-Oct-08 8:23 
Questionusing lparam parameter of SendMessage function Pin
Sandeep Kalra13-Oct-08 22:37
Sandeep Kalra13-Oct-08 22:37 
Hi All

I have send keys to the application(other) which i have started using my windows form .
By using API and managed code SetForeGroundWindow.. and SendKeys.Send...
This is working fine.But while my application sends keys if a user click on any other window then that(window on which user clicked) get the keys not the window for which it was meant.


So i had to chose other way.

Now I am using SendMeassage API and I want to send a Key to that application

[DllImport("User32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(int hWnd, int Msg, int wParam,int lParam);


I have got the handle(hwnd) of the window to which i want to send a key(for here say F1 key)


public const WM_KEYDOWN =0x100; /which is one of the possible value of msg
/Here It is for keydown event.

public const VK_F1=0x70;
// it is a virtual key code for F1 to be passed in wparam

For lparam i have following inf

lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.
31
Specifies the transition state. The value is always zero for a WM_KEYDOWN message.

Return Value

An application should return zero if it processes this message.



I do not know how to pass lparam to the function.


Note:I have set 0x00 for lparam and i am gettingreturn value 0 which i had stored in a variable.This means the message was processed by the window according to return value condition above.But I did not saw any Help window of that application.


Please guide in using lparam particularly for case of KeyDown msg of F1


Thanks

THE SK
(Sandeep Kalra)
"I am the One"
AnswerRe: using lparam parameter of SendMessage function Pin
Simon P Stevens13-Oct-08 23:12
Simon P Stevens13-Oct-08 23:12 
GeneralRe: using lparam parameter of SendMessage function Pin
Sandeep Kalra13-Oct-08 23:47
Sandeep Kalra13-Oct-08 23:47 
GeneralRe: using lparam parameter of SendMessage function Pin
Simon P Stevens14-Oct-08 0:30
Simon P Stevens14-Oct-08 0:30 
GeneralRe: using lparam parameter of SendMessage function Pin
Sandeep Kalra14-Oct-08 0:52
Sandeep Kalra14-Oct-08 0:52 
GeneralRe: using lparam parameter of SendMessage function Pin
Simon P Stevens14-Oct-08 2:47
Simon P Stevens14-Oct-08 2:47 
QuestionRe: using lparam parameter of SendMessage function Pin
Mark Salsbery14-Oct-08 4:42
Mark Salsbery14-Oct-08 4:42 
AnswerRe: using lparam parameter of SendMessage function Pin
Sandeep Kalra14-Oct-08 18:23
Sandeep Kalra14-Oct-08 18:23 
AnswerRe: using lparam parameter of SendMessage function [modified] Pin
#realJSOP13-Oct-08 23:49
professional#realJSOP13-Oct-08 23:49 
QuestionAjax modal pop extender query Pin
dsaikrishna13-Oct-08 22:18
dsaikrishna13-Oct-08 22:18 
QuestionInvalid character while using xmldocument.load? Pin
.NetRams13-Oct-08 20:32
.NetRams13-Oct-08 20:32 
AnswerRe: Invalid character while using xmldocument.load? Pin
Guffa13-Oct-08 20:34
Guffa13-Oct-08 20:34 
AnswerRe: Invalid character while using xmldocument.load? Pin
Brij13-Oct-08 22:56
mentorBrij13-Oct-08 22:56 
AnswerRe: Invalid character while using xmldocument.load? Pin
Jakob Olsen14-Oct-08 0:58
Jakob Olsen14-Oct-08 0:58 
JokeRe: Invalid character while using xmldocument.load? Pin
Guffa14-Oct-08 2:51
Guffa14-Oct-08 2:51 
GeneralRe: Invalid character while using xmldocument.load? Pin
Mark Salsbery14-Oct-08 4:46
Mark Salsbery14-Oct-08 4:46 
QuestionHelp in WMI Pin
lal001213-Oct-08 20:20
lal001213-Oct-08 20:20 
AnswerRe: Help in WMI Pin
Uros Calakovic14-Oct-08 4:38
Uros Calakovic14-Oct-08 4:38 

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.