Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
AnswerRe: Red Five Labs + C# Pin
Dan Mos26-Feb-12 9:00
Dan Mos26-Feb-12 9:00 
QuestionRe: Red Five Labs + C# Pin
jojoba201126-Feb-12 23:18
jojoba201126-Feb-12 23:18 
AnswerRe: Red Five Labs + C# Pin
Pete O'Hanlon27-Feb-12 0:08
mvePete O'Hanlon27-Feb-12 0:08 
Questioncant read joystick data Managed DX, SlimDX Pin
DerecL25-Feb-12 13:07
DerecL25-Feb-12 13:07 
QuestionHelp need regarding SendMessageTimeout for IE window Pin
vishal nerkar25-Feb-12 7:51
vishal nerkar25-Feb-12 7:51 
AnswerRe: Help need regarding SendMessageTimeout for IE window Pin
DaveyM6925-Feb-12 8:35
professionalDaveyM6925-Feb-12 8:35 
GeneralRe: Help need regarding SendMessageTimeout for IE window Pin
vishal nerkar25-Feb-12 20:37
vishal nerkar25-Feb-12 20:37 
GeneralRe: Help need regarding SendMessageTimeout for IE window Pin
DaveyM6925-Feb-12 23:20
professionalDaveyM6925-Feb-12 23:20 
According to MSDN[^]:
If the function succeeds, the return value is nonzero.

so it is definitely succeeding.

I don't think it will make any difference to your exact problem, but your function declaration is not correct. You shouldn't use int where it should be IntPtr as int is always 32 bits but IntPtr will be 64 bits on a 64 bit system. I would use:
C#
using System;
using System.Runtime.InteropServices;

internal static class NativeMethods
{
    public const int SMTO_NORMAL = 0x0000;
    public const int SMTO_BLOCK = 0x0001;
    public const int SMTO_ABORTIFHUNG = 0x0002;
    public const int SMTO_NOTIMEOUTIFNOTHUNG = 0x0008;
    public const int SMTO_ERRORONEXIT = 0x0020;

    // http://msdn.microsoft.com/en-us/library/windows/desktop/ms644952(v=vs.85).aspx
    /*
LRESULT WINAPI SendMessageTimeout(
__in       HWND hWnd,
__in       UINT Msg,
__in       WPARAM wParam,
__in       LPARAM lParam,
__in       UINT fuFlags,
__in       UINT uTimeout,
__out_opt  PDWORD_PTR lpdwResult
); */
    [DllImport("User32.dll", SetLastError = true)]
    public static extern IntPtr SendMessageTimeout(
        IntPtr hWnd,
        int Msg, // could use uint
        IntPtr wParam,
        IntPtr lParam,
        int fuFlags, // could use uint
        int uTimeout, // could use uint
        out IntPtr lpdwResult);
}

I have never tried to get HTML this way so I really can't help any further without some experimenting - if I get time I will have a look.

Edit: I have had a quick play around. In my tests, lRes (lpdwResult) always sets a zero pointer - I haven't found out what exactly this is supposed to be - MSDN just states:
The value of this parameter depends on the message that is specified.


Have you seen the code here[^] - perhaps that can help?
Dave

Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.
Astonish us. Be exceptional. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)




modified 26-Feb-12 6:18am.

GeneralRe: Help need regarding SendMessageTimeout for IE window Pin
vishal nerkar26-Feb-12 3:11
vishal nerkar26-Feb-12 3:11 
Questionhelp me: when installing the management software, often times it built the database into it, so how do I do that? thank you! Pin
ajax_vn25-Feb-12 5:56
ajax_vn25-Feb-12 5:56 
AnswerRe: help me: when installing the management software, often times it built the database into it, so how do I do that? thank you! Pin
Dave Kreskowiak25-Feb-12 6:21
mveDave Kreskowiak25-Feb-12 6:21 
AnswerRe: help me: when installing the management software, often times it built the database into it, so how do I do that? thank you! Pin
Abhinav S25-Feb-12 17:16
Abhinav S25-Feb-12 17:16 
QuestionGet Active mdichild form Pin
Mr.Kode25-Feb-12 2:11
Mr.Kode25-Feb-12 2:11 
AnswerRe: Get Active mdichild form Pin
Alisaunder25-Feb-12 2:49
Alisaunder25-Feb-12 2:49 
GeneralRe: Get Active mdichild form Pin
Mr.Kode25-Feb-12 22:36
Mr.Kode25-Feb-12 22:36 
GeneralRe: Get Active mdichild form Pin
Alisaunder26-Feb-12 13:13
Alisaunder26-Feb-12 13:13 
Questionto filter datagridview records having column having null value Pin
polachan24-Feb-12 9:06
polachan24-Feb-12 9:06 
AnswerRe: to filter datagridview records having column having null value Pin
Eddy Vluggen24-Feb-12 9:42
professionalEddy Vluggen24-Feb-12 9:42 
AnswerRe: to filter datagridview records having column having null value Pin
polachan28-Feb-12 23:42
polachan28-Feb-12 23:42 
GeneralRe: to filter datagridview records having column having null value Pin
Eddy Vluggen29-Feb-12 0:26
professionalEddy Vluggen29-Feb-12 0:26 
Questiondata akses to mySql using c# Pin
tian's emo24-Feb-12 2:52
tian's emo24-Feb-12 2:52 
AnswerRe: data akses to mySql using c# Pin
R. Giskard Reventlov24-Feb-12 5:32
R. Giskard Reventlov24-Feb-12 5:32 
GeneralRe: data akses to mySql using c# Pin
tian's emo25-Feb-12 1:28
tian's emo25-Feb-12 1:28 
AnswerRe: data akses to mySql using c# Pin
kid sister24-Feb-12 18:22
kid sister24-Feb-12 18:22 
QuestionCompress with java decompress with c# Pin
Hossein Khalaj24-Feb-12 2:46
Hossein Khalaj24-Feb-12 2:46 

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.