Help in conversion of C# code into node.js(FFI) equivalent

394 views
Skip to first unread message

Vinod Nair

unread,
Jun 18, 2013, 7:29:49 AM6/18/13
to nod...@googlegroups.com
Hi All,

I have been stuck with the following problem for few days. I have tried few things, however am not able to get this working.

WID_STR = 0x7D
IntPtr X= new IntPtr(Convert.ToInt32(WID_STR, 16));

Please help.

Thanks
Vinod

Michael Schoonmaker

unread,
Jun 18, 2013, 2:51:52 PM6/18/13
to nod...@googlegroups.com
Vinod,
There's a lot about the surrounding code we'd have to know to make sense of these lines (IntPtr has way too many uses). The best I can tell is that you're looking for the global parseInt function:


Try `parseInt(string, 16)`.


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vinod Nair

unread,
Jun 19, 2013, 1:31:31 AM6/19/13
to nod...@googlegroups.com, michael.r....@gmail.com
Hi Michael,

Thank you for the response.

What I am trying to do is to click on the Notepad (File->New) using the SendMessageA command.
The third param of the SendMessageA is a int32 and I am trying to convert my WID to provide as an input for it.

IntPtr menuHandle = new IntPtr(Convert.ToInt32(menuActionCodeString, 16));
SendMessage(winHandle,(int)WinApiNativeMethods.WindowsMessages.WM_COMMAND, menuHandle ,IntPtr.Zero);

Thanks
Vinod
Reply all
Reply to author
Forward
0 new messages