Loading ...
Sorry, an error occurred while loading the content.
 

Re: "Invalid menu handle" written to error.log

Expand Messages
  • stefanhes
    Dear Greg WindowWidth = 100:WindowHeight = 200 will show something! RegionWindow.WindowWidth = 576: RegionWindow.WindowHeight = 453 is doing nothing!! hth
    Message 1 of 3 , Jul 4, 2008
      Dear Greg

      WindowWidth = 100:WindowHeight = 200

      will show something!


      RegionWindow.WindowWidth = 576: RegionWindow.WindowHeight = 453
      is doing nothing!!

      hth

      Stefan Hesseling
    • gregsweitzer
      Thanks, Stefan. I tried remarking out the line: RegionWindow.WindowWidth = 576 : RegionWindow.WindowHeight = 453 but then the splash screen does not appear. A
      Message 2 of 3 , Jul 4, 2008
        Thanks, Stefan.

        I tried remarking out the line:
        RegionWindow.WindowWidth = 576 : RegionWindow.WindowHeight = 453
        but then the splash screen does not appear. A tab opens on the
        taskbar, but no window is visible.

        Changing WindowWidth and WindowHeight values has no effect either.

        I've discovered that when I compile this program, no error.log is
        written. Other than this, the program works as expected. Hmmm. Maybe I
        should just ignore the reported errors? Maybe I didn't include enough
        code.

        Greg



        [Splash]


        if PSplashHide = 1 then goto [DialStart] 'skip splash
        if CommandLine$ <> "" then goto [DialStart] 'don't splash after
        double-click icon

        splashname$="splash1c.bmp"
        dim info$(10, 10)
        files "", splashname$, info$(
        qtyFiles = val(info$(0, 0))
        if qtyFiles = 0 then goto [DialStart] 'if file does not exist
        - do not attempt to open it

        splashname$="splash1c.bmp"
        dim info$(10, 10)
        files "", splashname$, info$(
        qtyFiles = val(info$(0, 0))
        if qtyFiles = 0 then goto [DialStart] 'if file does not exist
        - do not attempt to open it

        splashname$="splash1c.bmp"
        dim info$(10, 10)
        files "", splashname$, info$(
        qtyFiles = val(info$(0, 0))
        if qtyFiles = 0 then goto [DialStart] 'if file does not exist
        - do not attempt to open it

        pick = int(rnd(1)*3) + 1
        if pick = 1 then splashname$ = "splash1c.bmp"
        if pick = 2 then splashname$ = "splash2c.bmp"
        if pick = 3 then splashname$ = "splash3c.bmp"

        if splashname$ = "" then goto [DialStart]

        '******************************Open
        DLL's*******************************
        open "jpeg.dll"for DLL as #filer
        open "draw.dll" for dll as #draw
        '************************Set Up Window
        Offscreen************************
        nomainwin

        WindowWidth = 0 : WindowHeight = 0
        RegionWindow.WindowWidth = 576 : RegionWindow.WindowHeight = 453
        UpperLeftX = int((DisplayWidth-RegionWindow.WindowWidth)/2)
        UpperLeftY = int((DisplayHeight-RegionWindow.WindowHeight)/2)
        stylebits #RegionWindow.GB, 0, _WS_BORDER,0,0
        graphicbox #RegionWindow.GB, 0, 0, 577, 454
        open "KBNA" for window_popup as #RegionWindow 'this
        line writes "OS Warning: Invalid menu handle." to error log 2222
        #RegionWindow, "hide"
        '**********************************Load
        Image***************************
        tColor = 16711808
        mainGBh = hwnd(#RegionWindow.GB)
        hFileName = LoadImageFile(mainGBh, splashname$)
        loadbmp "screenshot", hFileName
        '***************************Set Mouse Events and
        drawbmp****************
        #RegionWindow.GB, "when leftButtonUp [RegionWindow.ButtonUp]"
        #RegionWindow.GB, "down;drawbmp screenshot 0 0";
        #RegionWindow.GB, "flush"
        '*****************************Set Up the
        Region**************************
        hbSrc = hbmp("screenshot")
        hReg=BitmapToRegion(hbSrc,tColor,1)
        h =hwnd(#RegionWindow)
        call SetWindowRgn h,hReg
        '******************************Move Window Back
        Onscreen*****************
        call MoveWindow2 h, UpperLeftX, UpperLeftY,
        RegionWindow.WindowWidth, RegionWindow.WindowHeight
        #RegionWindow, "show"
        t=time$("milliseconds") : while time$("milliseconds")<t+3200 :
        wend 'for some reason call Pause doesn't work..
        close #RegionWindow
        close #filer
        close #draw
        goto [DialStart]
        '**********************Close Window With Mouse
        EVent*********************
        [RegionWindow.ButtonUp]
        call DeleteObject h
        close #RegionWindow
        close #filer
        close #draw
        end
        '******************************Subs
        functions****************************
        sub SetWindowRgn hWnd, hRgn
        calldll #user32, "SetWindowRgn",_
        hWnd as long,_
        hRgn as long,_
        1 as boolean,_
        returnSWR as long
        end sub
        sub MoveWindow2 hdl, xTop, yLeft, Winderwidth, Winderheight
        calldll #user32, "MoveWindow",_
        hdl As Long,_
        xTop As Long,_
        yLeft As Long,_
        Winderwidth As Long,_
        Winderheight As Long,_
        0 As Long,_
        resultMW As Long
        end sub
        sub DeleteObject hObject
        calldll #gdi32, "DeleteObject",_
        hObject as long,_
        resultDO as long
        end sub
        function LoadImageFile(hWnd, file$)
        calldll #filer, "LoadImageFile",_
        hWnd as ulong,_
        file$ as ptr,_
        LoadImageFile as ulong
        end function
        Function BitmapToRegion(hBmp,cTransparentColor,cTolerance)
        calldll #draw, "BitmapToRegion",_
        hBmp As Long,_
        cTransparentColor As Long,_
        cTolerance As Long,_
        BitmapToRegion As Long
        End Function








        --- In libertybasic@yahoogroups.com, "stefanhes" <sjmhesseling@...> wrote:
        >
        > Dear Greg
        >
        > WindowWidth = 100:WindowHeight = 200
        >
        > will show something!
        >
        >
        > RegionWindow.WindowWidth = 576: RegionWindow.WindowHeight = 453
        > is doing nothing!!
        >
        > hth
        >
        > Stefan Hesseling
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.