الشبكة العربية لمطوري الألعاب

محترف مشرف عبد اللطيف حاجي علي مشاركة 1

السلام عليكم,
هل لدى أحد فكرة عن كيفية فتح صفحة Internet في متصفح الانترنيت الافتراضي؟
مرة أخرى، لقد بحثت في الـ MSDN و لم أجد أي شي عن ذلك عدا في #C و VB .NET (أعتقد أنه أصبح من الضروري تعلّم لأحدهما)

عبد اللطيف حاجي علي
مبرمج
In|Framez

خبير  Mohammad Khashashneh مشاركة 2

I know this is a very late response but when I tried to do it back then it wasn`t working. But now I know why.

First of all use
ShellExecute(NULL,"open","http://www.microsoft.com",NULL , NULL ,
SW_SHOWNORMAL) ;
That should open the Microsoft page with the default browser on your system. But the important thing is that you have to link shell32.lib

It`s funny, They should document this more clearly. I remember having trouble to add an outlook bar like on a dialog. And I was using an undocumented shell function it gave me a headache for 2 days. Anyway I hope that helps.

Mohammad Khashashneh

من سار على الدرب وصل, من جد وجد...
بس عتبك على اللي بيسمع

محترف مشرف عبد اللطيف حاجي علي هذه المشاركة مميزة مشاركة 3

التعليق على مشاركة Kasho في Aug 15, 2005 12:49 :

> First of all use
> ShellExecute(NULL,"open","http://www.microsoft.com",NULL
> , NULL ,
> SW_SHOWNORMAL) ;
> That should open the Microsoft
> page with the default browser on your system. But the
> important thing is that you have to link shell32.lib
>
> It`s
> funny, They should document this more clearly. I remember
> having trouble to add an outlook bar like on a dialog.
> And I was using an undocumented shell function it gave
> me a headache for 2 days. Anyway I hope that helps.
>

First of all: shell32.lib IS documented, it's in the "Function Information"

I tried to use this in my code before I post this question, but surprisingly enough, it didn't work returning "Access denied" error and triggering two exceptions!!! Although when I tried this in a bran new project it opened the default browser like any descent function… First I wasn't sure whose fault was it, me or Windows, and as usual I blamed Windows… But, before a week or so, I found a webpage describing why did ShellExecute() fail. It said that ShellExecute() can't do certain things (like opening a webpage in the default browser) in a multithreaded application (like calling CoInitializeEx() with COINIT_MULTITHREADED as a parameter) the author (of the webpage, that is) suggested the use of rundll.exe (a very handful application that starts whenever Windows starts) this application has functions that can do many things including FileProtocolHandler() which does exactly what we need…

Oh BTW, the link is: http://msdn.microsoft.com/msdnmag/issues/05/03/CATWork/

Cheers,

عبد اللطيف حاجي علي
مبرمج
In|Framez

خبير  Mohammad Khashashneh مشاركة 4

And I always wondered how do they do that stuff !

So Rundll.exe. I gusee this will solve alot of problems for me. But you have to be carefull if you want to run the application on different platforms of Old and New Windows. The funcionality may be different. It has to be tested first.

Anyway, Thanks for the information.

Mohammad Khashashneh

من سار على الدرب وصل, من جد وجد...
بس عتبك على اللي بيسمع