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

C#

 
AnswerRe: Help with impersonation please Pin
Luc Pattyn26-Feb-12 7:39
sitebuilderLuc Pattyn26-Feb-12 7:39 
GeneralRe: Help with impersonation please Pin
CCodeNewbie26-Feb-12 10:10
CCodeNewbie26-Feb-12 10:10 
AnswerRe: Help with impersonation please Pin
Luc Pattyn26-Feb-12 6:14
sitebuilderLuc Pattyn26-Feb-12 6:14 
GeneralRe: Help with impersonation please Pin
CCodeNewbie26-Feb-12 6:53
CCodeNewbie26-Feb-12 6:53 
QuestionConverting audio file into a binary display Pin
kfir.alf26-Feb-12 3:20
kfir.alf26-Feb-12 3:20 
AnswerRe: Converting audio file into a binary display Pin
OriginalGriff26-Feb-12 4:12
mveOriginalGriff26-Feb-12 4:12 
GeneralRe: Converting audio file into a binary display Pin
kfir.alf26-Feb-12 4:56
kfir.alf26-Feb-12 4:56 
GeneralRe: Converting audio file into a binary display Pin
Eddy Vluggen26-Feb-12 11:11
professionalEddy Vluggen26-Feb-12 11:11 
GeneralRe: Converting audio file into a binary display Pin
V.26-Feb-12 21:14
professionalV.26-Feb-12 21:14 
QuestionRed Five Labs + C# Pin
jojoba201125-Feb-12 22:46
jojoba201125-Feb-12 22:46 
AnswerRe: Red Five Labs + C# Pin
Dan Mos26-Feb-12 3:48
Dan Mos26-Feb-12 3:48 
QuestionRe: Red Five Labs + C# Pin
jojoba201126-Feb-12 4:01
jojoba201126-Feb-12 4:01 
AnswerRe: Red Five Labs + C# Pin
OriginalGriff26-Feb-12 4:15
mveOriginalGriff26-Feb-12 4:15 
QuestionRe: Red Five Labs + C# Pin
jojoba201126-Feb-12 4:23
jojoba201126-Feb-12 4:23 
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 

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.