Delphi Users - A couple of useful code snippets
-
- KVRAF
- Topic Starter
- 3723 posts since 17 Apr, 2002 from Scotland
I've been finishing off a new plug and am now in the habit of adding a weblink and an email link to the GUI. Took me a while to suss out the first time, so I thought I'd share
To open a web page on a click use the following :-
ShellExecute(GetDesktopWindow(), 'open', PChar('http://www.djmarko.pwp.blueyonder.co.uk'), nil, nil, SW_SHOWNORMAL);
To open the users email client, ready to send an email to you , use :-
ShellExecute(GetDesktopWindow(), 'open', PChar('mailto:scuzzphut@blueyonder.co.uk'), nil, nil, SW_SHOWNORMAL);
Both will require you to add "shellapi" to your "uses" list under "interface"
To open a web page on a click use the following :-
ShellExecute(GetDesktopWindow(), 'open', PChar('http://www.djmarko.pwp.blueyonder.co.uk'), nil, nil, SW_SHOWNORMAL);
To open the users email client, ready to send an email to you , use :-
ShellExecute(GetDesktopWindow(), 'open', PChar('mailto:scuzzphut@blueyonder.co.uk'), nil, nil, SW_SHOWNORMAL);
Both will require you to add "shellapi" to your "uses" list under "interface"
-
- KVRAF
- 4644 posts since 28 Nov, 2002 from Chicago
Cool, I was just gearing up to research how to solve this very issue.scuzzphut wrote:To open a web page on a click use the following :-
ShellExecute(GetDesktopWindow(), 'open', PChar('http://www.djmarko.pwp.blueyonder.co.uk'), nil, nil, SW_SHOWNORMAL);
Cheers
Someone shot the food. Remember: don't shoot food!
-
- KVRist
- 64 posts since 29 Oct, 2003 from London
-
- KVRist
- 64 posts since 29 Oct, 2003 from London
Ahh. For some reason this doesn't seem to like being called from a DIB component.
My solution is to put in a timer started by the DIB component and have the timer open the webpage - so decoupling the DIB component from the call.
Seems to work.
My solution is to put in a timer started by the DIB component and have the timer open the webpage - so decoupling the DIB component from the call.
Seems to work.
-
- KVRAF
- Topic Starter
- 3723 posts since 17 Apr, 2002 from Scotland
I call these from the onclick() in a dibImage. Works fine.
Thanks for sharing the workaround , though. I'll wager you're not the only one affected.
Thanks for sharing the workaround , though. I'll wager you're not the only one affected.