HELP: Info Dialog in BPW 
Author Message
 HELP: Info Dialog in BPW

Hi !

Have you seen how BPW or Netscape starts ? Before the main window pops up you can see little
info window [ usualy with some bitmap or icon ] which tells what program is loading and so on ...
[ Borland Pascal for windows 7.0 Copyright .... for BPW ]. I want to do it myself , but this just
don't go :-( I created simple dialog with bitmap and some text in ResorceWorkshop , but I can't
load it! As I understand it I must use the DialogBox function to open it as modal dialog , but
the only result I have - General protection fault ... :-( Here's my code :

{$R XKill.RES}  {This is my resorce file. Dialog I want to display is named "About" );
USES OWindows,ODialogs,WINCRT,WInAPI,toolhelp,Win31,WinProcs,WinTypes,MMSystem,Strings;
{ I use everything I can to be shure :-) }

VAR DHook:tFarProc;
    DInt:integer;

function DefDlgProc(Dlg:hWnd;Msg,wParam:Word;lParam:LongInt):LongInt;
begin
   WasteSomeTime;  {Delay , so user can read the info in the dialog}
   EndDialog(hInstance,DInt);
end;

BEGIN

    DInt:=DialogBox(hInstance,'About',0,DHook);
END.

But this don't work ! I must be missing something :-( So , it would be so kind of you to post here
any ideas or [ I'm looking forward to see this ] brief example.

10xxxx in advance :-)

C U PalZ :-)



Wed, 18 Jun 1902 08:00:00 GMT  
 HELP: Info Dialog in BPW

Quote:
>Hi !
>Have you seen how BPW or Netscape starts ? Before the main window pops up you can see little
>info window [ usualy with some bitmap or icon ] which tells what program is loading and so on ...
>[ Borland pascal for windows 7.0 Copyright .... for BPW ]. I want to do it myself , but this just
>don't go :-( I created simple dialog with bitmap and some text in ResorceWorkshop , but I can't
>load it! As I understand it I must use the DialogBox function to open it as modal dialog , but
>the only result I have - General protection fault ... :-( Here's my code :
>{$R XKill.RES}  {This is my resorce file. Dialog I want to display is named "About" );
>USES OWindows,ODialogs,WINCRT,WInAPI,toolhelp,Win31,WinProcs,WinTypes,MMSystem,Strings;
>{ I use everything I can to be shure :-) }
>VAR DHook:tFarProc;
>    DInt:integer;
>function DefDlgProc(Dlg:hWnd;Msg,wParam:Word;lParam:LongInt):LongInt;
>begin
>   WasteSomeTime;  {Delay , so user can read the info in the dialog}
>   EndDialog(hInstance,DInt);
>end;
>BEGIN

>    DInt:=DialogBox(hInstance,'About',0,DHook);
>END.
>But this don't work ! I must be missing something :-( So , it would be so kind of you to post here
>any ideas or [ I'm looking forward to see this ] brief example.

>10xxxx in advance :-)
>C U PalZ :-)

This procedure comes directly from the OWL chess demo included
in the BPW7.0 package, I have not tested it outside that program.

procedure ShowSplashScreen(var R: TRect);
var
  BM: HBitmap;
  DC, MemDC: HDC;
  BitInfo: TBitmap;
begin
  DC := GetDC(0);
  MemDC := CreateCompatibleDC(DC);
  BM := LoadBitmap(HInstance, PChar(bmBlaise));

  BM := SelectObject(MemDC, BM);   { swap BMs}
  R.Left := GetDeviceCaps(DC,HORZRES) div 2 - BitInfo.bmWidth div 2;
  R.Top := GetDeviceCaps(DC,VERTRES) div 2 - BitInfo.bmHeight div 2;
  BitBlt(DC, R.Left, R.Top, BitInfo.bmWidth, BitInfo.bmHeight,
         MemDC, 0, 0, SrcCopy);
  DeleteObject(SelectObject(MemDC, BM));
  DeleteDC(MemDC);
  ReleaseDC(0, DC);
  R.Right := R.Left + BitInfo.bmWidth;
  R.Bottom := R.Top + BitInfo.bmHeight;
end;


        -Jes R Klinke



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP: Info dialog in BPW

2. W95/98 FileOpen/FileSaveAs Dialog for TPW / BPW.

3. (un)fun with tabbed dialogs/child dialogs/buttons

4. Modal dialog on Modal dialog

5. Info-Pascal still around? (was subscribe info-pascal)

6. Help! Password dialog

7. bpw help file

8. Database help with BPW

9. BPW/TP Help

10. TPW HELP: changing the caption of a dialog

11. HELP: Foreign Carac. in BPW 7.0

 

 
Powered by phpBB® Forum Software