Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11766 > unrolled thread

Save ShellWindow size position and reset for opening

Started byRamazan YETİŞİR <ryetisir@gmail.com>
First post2018-07-18 09:09 -0700
Last post2018-07-19 17:01 +0200
Articles 10 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Save ShellWindow size position and reset for opening Ramazan YETİŞİR <ryetisir@gmail.com> - 2018-07-18 09:09 -0700
    Re: Save ShellWindow size position and reset for opening JohnMartens <martens@tennishulp.info> - 2018-07-18 18:44 +0200
      Re: Save ShellWindow size position and reset for opening Ramazan YETİŞİR <ryetisir@gmail.com> - 2018-07-18 09:58 -0700
        Re: Save ShellWindow size position and reset for opening Ramazan YETİŞİR <ryetisir@gmail.com> - 2018-07-18 10:49 -0700
          Re: Save ShellWindow size position and reset for opening JohnMartens <martens@tennishulp.info> - 2018-07-18 21:55 +0200
            Re: Save ShellWindow size position and reset for opening Ramazan <ryetisir@gmail.com> - 2018-07-18 20:09 -0700
    Re: Save ShellWindow size position and reset for opening Leo_Bond <l.bond@bk.ru> - 2018-07-18 14:25 -0700
      Re: Save ShellWindow size position and reset for opening Ramazan <ryetisir@gmail.com> - 2018-07-18 20:14 -0700
        Re: Save ShellWindow size position and reset for opening James Martin <james@northwoodlumber.com> - 2018-07-19 10:37 -0400
        Re: Save ShellWindow size position and reset for opening JohnMartens <martens@tennishulp.info> - 2018-07-19 17:01 +0200

#11766 — Save ShellWindow size position and reset for opening

FromRamazan YETİŞİR <ryetisir@gmail.com>
Date2018-07-18 09:09 -0700
SubjectSave ShellWindow size position and reset for opening
Message-ID<d8b57156-b369-426e-8b99-b2665daa7efa@googlegroups.com>
Hi programers…

I'm actually using VOSP4 with bBrowser

I want my programs shellwindow position and reset in the opening.
I found the belove  codes in Google.clipper-visual-objects but could not do it work allready. Please help.


SysObject(self) in the init method of the shellwindow



METHOD SaveScreenSizePos() CLASS SShellWindow 

   LOCAL ScrLeft   as LONG
   LOCAL ScrTop    as LONG
   LOCAL ScrWidth  as LONG
   LOCAL ScrHeight as LONG

   LOCAL lpRect is _winRECT 
   LOCAL wTop, wLeft as int
   
   LOCAL sTotStr as STRING
   LOCAL oASReg as Class_HKLM 
        
   oASReg := Class_HKLM{} 
   oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
   
   SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))       
   SysObject():PutSet(ScrHeight, NTrim(SysObject():Size:Height))
    
   GetWindowRect( SysObject():Handle(), @lpRect )   
   wTop  := Max( lpRect.top, 0 ) 
   wLeft := Max( lpRect.Left,0 )
    
   SysObject():PutSet(ScrTop,  NTrim(wTop)) 
   SysObject():PutSet(ScrLeft, NTrim(wLeft))    
   
   sTotStr := Str( ScrLeft, -1, 0 ) + "," + Str( ScrTop, -1, 0 ) + "," + Str( ScrWidth, -1, 0 ) + "," + Str( ScrHeight, -1, 0 ) 
   oASReg:WriteString( "", "OKScrPos", sTotStr )   

RETURN nil 

for retrieve I use the registry

FUNCTION ReSetShellPosition( oMain ) 
   
   LOCAL ScrLeft   as int
   LOCAL ScrTop    as int
   LOCAL ScrWidth  as int
   LOCAL ScrHeight as int
   LOCAL sTotStr   as STRING
   LOCAL oASReg    as Class_HKLM   
   
   oASReg := Class_HKLM{}  
   oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
   sTotStr := oASReg:GetString( "", "OKScrPos" )     
    
   IF !Empty( sTotStr )
      ScrLeft := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) )
      sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
   
      ScrTop := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
      sTotStr := SubStr(sTotStr,  At( ",", sTotStr) + 1 )
 
      ScrWidth := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
      sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )     
   
      ScrHeight := int( _cast, sTotStr )
     
      SetWindowPos( oMain:Handle(), null_ptr, Val(oMain:GetSet(ScrLeft)), Val(oMain:GetSet(ScrTop)),; 
                    Val(oMain:GetSet(ScrWidth)), Val(oMain:GetSet(ScrHeight)), SWP_SHOWWINDOW )
   ENDIF
   
RETURN nil 

any idea is valuable for me,
thanks many

[toc] | [next] | [standalone]


#11767

FromJohnMartens <martens@tennishulp.info>
Date2018-07-18 18:44 +0200
Message-ID<pinqq5$knn$1@dont-email.me>
In reply to#11766
Can you tell till which part it works ?
John

Op 18-7-2018 om 18:09 schreef Ramazan YETİŞİR:
> Hi programers…
> 
> I'm actually using VOSP4 with bBrowser
> 
> I want my programs shellwindow position and reset in the opening.
> I found the belove  codes in Google.clipper-visual-objects but could not do it work allready. Please help.
> 
> 
> SysObject(self) in the init method of the shellwindow
> 
> 
> 
> METHOD SaveScreenSizePos() CLASS SShellWindow
> 
>     LOCAL ScrLeft   as LONG
>     LOCAL ScrTop    as LONG
>     LOCAL ScrWidth  as LONG
>     LOCAL ScrHeight as LONG
> 
>     LOCAL lpRect is _winRECT
>     LOCAL wTop, wLeft as int
>     
>     LOCAL sTotStr as STRING
>     LOCAL oASReg as Class_HKLM
>          
>     oASReg := Class_HKLM{}
>     oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
>     
>     SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))
>     SysObject():PutSet(ScrHeight, NTrim(SysObject():Size:Height))
>      
>     GetWindowRect( SysObject():Handle(), @lpRect )
>     wTop  := Max( lpRect.top, 0 )
>     wLeft := Max( lpRect.Left,0 )
>      
>     SysObject():PutSet(ScrTop,  NTrim(wTop))
>     SysObject():PutSet(ScrLeft, NTrim(wLeft))
>     
>     sTotStr := Str( ScrLeft, -1, 0 ) + "," + Str( ScrTop, -1, 0 ) + "," + Str( ScrWidth, -1, 0 ) + "," + Str( ScrHeight, -1, 0 )
>     oASReg:WriteString( "", "OKScrPos", sTotStr )
> 
> RETURN nil
> 
> for retrieve I use the registry
> 
> FUNCTION ReSetShellPosition( oMain )
>     
>     LOCAL ScrLeft   as int
>     LOCAL ScrTop    as int
>     LOCAL ScrWidth  as int
>     LOCAL ScrHeight as int
>     LOCAL sTotStr   as STRING
>     LOCAL oASReg    as Class_HKLM
>     
>     oASReg := Class_HKLM{}
>     oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
>     sTotStr := oASReg:GetString( "", "OKScrPos" )
>      
>     IF !Empty( sTotStr )
>        ScrLeft := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) )
>        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
>     
>        ScrTop := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
>        sTotStr := SubStr(sTotStr,  At( ",", sTotStr) + 1 )
>   
>        ScrWidth := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
>        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
>     
>        ScrHeight := int( _cast, sTotStr )
>       
>        SetWindowPos( oMain:Handle(), null_ptr, Val(oMain:GetSet(ScrLeft)), Val(oMain:GetSet(ScrTop)),;
>                      Val(oMain:GetSet(ScrWidth)), Val(oMain:GetSet(ScrHeight)), SWP_SHOWWINDOW )
>     ENDIF
>     
> RETURN nil
> 
> any idea is valuable for me,
> thanks many
> 

[toc] | [prev] | [next] | [standalone]


#11768

FromRamazan YETİŞİR <ryetisir@gmail.com>
Date2018-07-18 09:58 -0700
Message-ID<8f509520-49da-494e-aadc-8711f37be172@googlegroups.com>
In reply to#11767
On Wednesday, 18 July 2018 19:44:54 UTC+3, JohnMartens  wrote:
> Can you tell till which part it works ?
> John
> 
> Op 18-7-2018 om 18:09 schreef Ramazan YETİŞİR:
> > Hi programers…
> > 
> > I'm actually using VOSP4 with bBrowser
> > 
> > I want my programs shellwindow position and reset in the opening.
> > I found the belove  codes in Google.clipper-visual-objects but could not do it work allready. Please help.
> > 
> > 
> > SysObject(self) in the init method of the shellwindow
> > 
> > 
> > 
> > METHOD SaveScreenSizePos() CLASS SShellWindow
> > 
> >     LOCAL ScrLeft   as LONG
> >     LOCAL ScrTop    as LONG
> >     LOCAL ScrWidth  as LONG
> >     LOCAL ScrHeight as LONG
> > 
> >     LOCAL lpRect is _winRECT
> >     LOCAL wTop, wLeft as int
> >     
> >     LOCAL sTotStr as STRING
> >     LOCAL oASReg as Class_HKLM
> >          
> >     oASReg := Class_HKLM{}
> >     oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
> >     
> >     SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))
> >     SysObject():PutSet(ScrHeight, NTrim(SysObject():Size:Height))
> >      
> >     GetWindowRect( SysObject():Handle(), @lpRect )
> >     wTop  := Max( lpRect.top, 0 )
> >     wLeft := Max( lpRect.Left,0 )
> >      
> >     SysObject():PutSet(ScrTop,  NTrim(wTop))
> >     SysObject():PutSet(ScrLeft, NTrim(wLeft))
> >     
> >     sTotStr := Str( ScrLeft, -1, 0 ) + "," + Str( ScrTop, -1, 0 ) + "," + Str( ScrWidth, -1, 0 ) + "," + Str( ScrHeight, -1, 0 )
> >     oASReg:WriteString( "", "OKScrPos", sTotStr )
> > 
> > RETURN nil
> > 
> > for retrieve I use the registry
> > 
> > FUNCTION ReSetShellPosition( oMain )
> >     
> >     LOCAL ScrLeft   as int
> >     LOCAL ScrTop    as int
> >     LOCAL ScrWidth  as int
> >     LOCAL ScrHeight as int
> >     LOCAL sTotStr   as STRING
> >     LOCAL oASReg    as Class_HKLM
> >     
> >     oASReg := Class_HKLM{}
> >     oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
> >     sTotStr := oASReg:GetString( "", "OKScrPos" )
> >      
> >     IF !Empty( sTotStr )
> >        ScrLeft := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) )
> >        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
> >     
> >        ScrTop := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
> >        sTotStr := SubStr(sTotStr,  At( ",", sTotStr) + 1 )
> >   
> >        ScrWidth := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
> >        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
> >     
> >        ScrHeight := int( _cast, sTotStr )
> >       
> >        SetWindowPos( oMain:Handle(), null_ptr, Val(oMain:GetSet(ScrLeft)), Val(oMain:GetSet(ScrTop)),;
> >                      Val(oMain:GetSet(ScrWidth)), Val(oMain:GetSet(ScrHeight)), SWP_SHOWWINDOW )
> >     ENDIF
> >     
> > RETURN nil
> > 
> > any idea is valuable for me,
> > thanks many
> >

in line SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))    PutSet method is not working

[toc] | [prev] | [next] | [standalone]


#11769

FromRamazan YETİŞİR <ryetisir@gmail.com>
Date2018-07-18 10:49 -0700
Message-ID<b8dbc75e-b53b-405b-97ce-8dd21b57f036@googlegroups.com>
In reply to#11768
On Wednesday, 18 July 2018 19:58:19 UTC+3, Ramazan YETİŞİR  wrote:
> On Wednesday, 18 July 2018 19:44:54 UTC+3, JohnMartens  wrote:
> > Can you tell till which part it works ?
> > John
> > 
> > Op 18-7-2018 om 18:09 schreef Ramazan YETİŞİR:
> > > Hi programers…
> > > 
> > > I'm actually using VOSP4 with bBrowser
> > > 
> > > I want my programs shellwindow position and reset in the opening.
> > > I found the belove  codes in Google.clipper-visual-objects but could not do it work allready. Please help.
> > > 
> > > 
> > > SysObject(self) in the init method of the shellwindow
> > > 
> > > 
> > > 
> > > METHOD SaveScreenSizePos() CLASS SShellWindow
> > > 
> > >     LOCAL ScrLeft   as LONG
> > >     LOCAL ScrTop    as LONG
> > >     LOCAL ScrWidth  as LONG
> > >     LOCAL ScrHeight as LONG
> > > 
> > >     LOCAL lpRect is _winRECT
> > >     LOCAL wTop, wLeft as int
> > >     
> > >     LOCAL sTotStr as STRING
> > >     LOCAL oASReg as Class_HKLM
> > >          
> > >     oASReg := Class_HKLM{}
> > >     oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
> > >     
> > >     SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))
> > >     SysObject():PutSet(ScrHeight, NTrim(SysObject():Size:Height))
> > >      
> > >     GetWindowRect( SysObject():Handle(), @lpRect )
> > >     wTop  := Max( lpRect.top, 0 )
> > >     wLeft := Max( lpRect.Left,0 )
> > >      
> > >     SysObject():PutSet(ScrTop,  NTrim(wTop))
> > >     SysObject():PutSet(ScrLeft, NTrim(wLeft))
> > >     
> > >     sTotStr := Str( ScrLeft, -1, 0 ) + "," + Str( ScrTop, -1, 0 ) + "," + Str( ScrWidth, -1, 0 ) + "," + Str( ScrHeight, -1, 0 )
> > >     oASReg:WriteString( "", "OKScrPos", sTotStr )
> > > 
> > > RETURN nil
> > > 
> > > for retrieve I use the registry
> > > 
> > > FUNCTION ReSetShellPosition( oMain )
> > >     
> > >     LOCAL ScrLeft   as int
> > >     LOCAL ScrTop    as int
> > >     LOCAL ScrWidth  as int
> > >     LOCAL ScrHeight as int
> > >     LOCAL sTotStr   as STRING
> > >     LOCAL oASReg    as Class_HKLM
> > >     
> > >     oASReg := Class_HKLM{}
> > >     oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
> > >     sTotStr := oASReg:GetString( "", "OKScrPos" )
> > >      
> > >     IF !Empty( sTotStr )
> > >        ScrLeft := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) )
> > >        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
> > >     
> > >        ScrTop := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
> > >        sTotStr := SubStr(sTotStr,  At( ",", sTotStr) + 1 )
> > >   
> > >        ScrWidth := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
> > >        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
> > >     
> > >        ScrHeight := int( _cast, sTotStr )
> > >       
> > >        SetWindowPos( oMain:Handle(), null_ptr, Val(oMain:GetSet(ScrLeft)), Val(oMain:GetSet(ScrTop)),;
> > >                      Val(oMain:GetSet(ScrWidth)), Val(oMain:GetSet(ScrHeight)), SWP_SHOWWINDOW )
> > >     ENDIF
> > >     
> > > RETURN nil
> > > 
> > > any idea is valuable for me,
> > > thanks many
> > >
> 
> 
John;
in line SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))    PutSet method is not working

[toc] | [prev] | [next] | [standalone]


#11770

FromJohnMartens <martens@tennishulp.info>
Date2018-07-18 21:55 +0200
Message-ID<pio5uk$ca$1@dont-email.me>
In reply to#11769
Is this the only place in your app where you write to the Register ?
I'm nog familiar with storing in the register. I store these kind of 
parameters in de data folder of my app

Is that an option to you ?

John

Op 18-7-2018 om 19:49 schreef Ramazan YETİŞİR:
> On Wednesday, 18 July 2018 19:58:19 UTC+3, Ramazan YETİŞİR  wrote:
>> On Wednesday, 18 July 2018 19:44:54 UTC+3, JohnMartens  wrote:
>>> Can you tell till which part it works ?
>>> John
>>>
>>> Op 18-7-2018 om 18:09 schreef Ramazan YETİŞİR:
>>>> Hi programers…
>>>>
>>>> I'm actually using VOSP4 with bBrowser
>>>>
>>>> I want my programs shellwindow position and reset in the opening.
>>>> I found the belove  codes in Google.clipper-visual-objects but could not do it work allready. Please help.
>>>>
>>>>
>>>> SysObject(self) in the init method of the shellwindow
>>>>
>>>>
>>>>
>>>> METHOD SaveScreenSizePos() CLASS SShellWindow
>>>>
>>>>      LOCAL ScrLeft   as LONG
>>>>      LOCAL ScrTop    as LONG
>>>>      LOCAL ScrWidth  as LONG
>>>>      LOCAL ScrHeight as LONG
>>>>
>>>>      LOCAL lpRect is _winRECT
>>>>      LOCAL wTop, wLeft as int
>>>>      
>>>>      LOCAL sTotStr as STRING
>>>>      LOCAL oASReg as Class_HKLM
>>>>           
>>>>      oASReg := Class_HKLM{}
>>>>      oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
>>>>      
>>>>      SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))
>>>>      SysObject():PutSet(ScrHeight, NTrim(SysObject():Size:Height))
>>>>       
>>>>      GetWindowRect( SysObject():Handle(), @lpRect )
>>>>      wTop  := Max( lpRect.top, 0 )
>>>>      wLeft := Max( lpRect.Left,0 )
>>>>       
>>>>      SysObject():PutSet(ScrTop,  NTrim(wTop))
>>>>      SysObject():PutSet(ScrLeft, NTrim(wLeft))
>>>>      
>>>>      sTotStr := Str( ScrLeft, -1, 0 ) + "," + Str( ScrTop, -1, 0 ) + "," + Str( ScrWidth, -1, 0 ) + "," + Str( ScrHeight, -1, 0 )
>>>>      oASReg:WriteString( "", "OKScrPos", sTotStr )
>>>>
>>>> RETURN nil
>>>>
>>>> for retrieve I use the registry
>>>>
>>>> FUNCTION ReSetShellPosition( oMain )
>>>>      
>>>>      LOCAL ScrLeft   as int
>>>>      LOCAL ScrTop    as int
>>>>      LOCAL ScrWidth  as int
>>>>      LOCAL ScrHeight as int
>>>>      LOCAL sTotStr   as STRING
>>>>      LOCAL oASReg    as Class_HKLM
>>>>      
>>>>      oASReg := Class_HKLM{}
>>>>      oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
>>>>      sTotStr := oASReg:GetString( "", "OKScrPos" )
>>>>       
>>>>      IF !Empty( sTotStr )
>>>>         ScrLeft := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) )
>>>>         sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
>>>>      
>>>>         ScrTop := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
>>>>         sTotStr := SubStr(sTotStr,  At( ",", sTotStr) + 1 )
>>>>    
>>>>         ScrWidth := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
>>>>         sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
>>>>      
>>>>         ScrHeight := int( _cast, sTotStr )
>>>>        
>>>>         SetWindowPos( oMain:Handle(), null_ptr, Val(oMain:GetSet(ScrLeft)), Val(oMain:GetSet(ScrTop)),;
>>>>                       Val(oMain:GetSet(ScrWidth)), Val(oMain:GetSet(ScrHeight)), SWP_SHOWWINDOW )
>>>>      ENDIF
>>>>      
>>>> RETURN nil
>>>>
>>>> any idea is valuable for me,
>>>> thanks many
>>>>
>>
>>
> John;
> in line SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))    PutSet method is not working
> 

[toc] | [prev] | [next] | [standalone]


#11772

FromRamazan <ryetisir@gmail.com>
Date2018-07-18 20:09 -0700
Message-ID<86f7e0f8-4d79-4090-ae34-bf799f2ae7ed@googlegroups.com>
In reply to#11770
On Wednesday, 18 July 2018 22:55:01 UTC+3, JohnMartens  wrote:
> Is this the only place in your app where you write to the Register ?
> I'm nog familiar with storing in the register. I store these kind of 
> parameters in de data folder of my app
> 
> Is that an option to you ?
> 
> John
> 
> Op 18-7-2018 om 19:49 schreef Ramazan YETİŞİR:
> > On Wednesday, 18 July 2018 19:58:19 UTC+3, Ramazan YETİŞİR  wrote:
> >> On Wednesday, 18 July 2018 19:44:54 UTC+3, JohnMartens  wrote:
> >>> Can you tell till which part it works ?
> >>> John
> >>>
> >>> Op 18-7-2018 om 18:09 schreef Ramazan YETİŞİR:
> >>>> Hi programers…
> >>>>
> >>>> I'm actually using VOSP4 with bBrowser
> >>>>
> >>>> I want my programs shellwindow position and reset in the opening.
> >>>> I found the belove  codes in Google.clipper-visual-objects but could not do it work allready. Please help.
> >>>>
> >>>>
> >>>> SysObject(self) in the init method of the shellwindow
> >>>>
> >>>>
> >>>>
> >>>> METHOD SaveScreenSizePos() CLASS SShellWindow
> >>>>
> >>>>      LOCAL ScrLeft   as LONG
> >>>>      LOCAL ScrTop    as LONG
> >>>>      LOCAL ScrWidth  as LONG
> >>>>      LOCAL ScrHeight as LONG
> >>>>
> >>>>      LOCAL lpRect is _winRECT
> >>>>      LOCAL wTop, wLeft as int
> >>>>      
> >>>>      LOCAL sTotStr as STRING
> >>>>      LOCAL oASReg as Class_HKLM
> >>>>           
> >>>>      oASReg := Class_HKLM{}
> >>>>      oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
> >>>>      
> >>>>      SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))
> >>>>      SysObject():PutSet(ScrHeight, NTrim(SysObject():Size:Height))
> >>>>       
> >>>>      GetWindowRect( SysObject():Handle(), @lpRect )
> >>>>      wTop  := Max( lpRect.top, 0 )
> >>>>      wLeft := Max( lpRect.Left,0 )
> >>>>       
> >>>>      SysObject():PutSet(ScrTop,  NTrim(wTop))
> >>>>      SysObject():PutSet(ScrLeft, NTrim(wLeft))
> >>>>      
> >>>>      sTotStr := Str( ScrLeft, -1, 0 ) + "," + Str( ScrTop, -1, 0 ) + "," + Str( ScrWidth, -1, 0 ) + "," + Str( ScrHeight, -1, 0 )
> >>>>      oASReg:WriteString( "", "OKScrPos", sTotStr )
> >>>>
> >>>> RETURN nil
> >>>>
> >>>> for retrieve I use the registry
> >>>>
> >>>> FUNCTION ReSetShellPosition( oMain )
> >>>>      
> >>>>      LOCAL ScrLeft   as int
> >>>>      LOCAL ScrTop    as int
> >>>>      LOCAL ScrWidth  as int
> >>>>      LOCAL ScrHeight as int
> >>>>      LOCAL sTotStr   as STRING
> >>>>      LOCAL oASReg    as Class_HKLM
> >>>>      
> >>>>      oASReg := Class_HKLM{}
> >>>>      oASReg:Working_Subkey := "Software\AgriSoft_Int\OKPSetings"
> >>>>      sTotStr := oASReg:GetString( "", "OKScrPos" )
> >>>>       
> >>>>      IF !Empty( sTotStr )
> >>>>         ScrLeft := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) )
> >>>>         sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
> >>>>      
> >>>>         ScrTop := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
> >>>>         sTotStr := SubStr(sTotStr,  At( ",", sTotStr) + 1 )
> >>>>    
> >>>>         ScrWidth := int( _cast, SubStr( sTotStr, 1, At(",", sTotStr) - 1 ))
> >>>>         sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1 )
> >>>>      
> >>>>         ScrHeight := int( _cast, sTotStr )
> >>>>        
> >>>>         SetWindowPos( oMain:Handle(), null_ptr, Val(oMain:GetSet(ScrLeft)), Val(oMain:GetSet(ScrTop)),;
> >>>>                       Val(oMain:GetSet(ScrWidth)), Val(oMain:GetSet(ScrHeight)), SWP_SHOWWINDOW )
> >>>>      ENDIF
> >>>>      
> >>>> RETURN nil
> >>>>
> >>>> any idea is valuable for me,
> >>>> thanks many
> >>>>
> >>
> >>
> > John;
> > in line SysObject():PutSet(ScrWidth, NTrim(SysObject():Size:Width))    PutSet method is not working
> >

I'm actually using the registry, I thought easy.

[toc] | [prev] | [next] | [standalone]


#11771

FromLeo_Bond <l.bond@bk.ru>
Date2018-07-18 14:25 -0700
Message-ID<d2f1d0e7-e8f9-43f0-b9ab-9e8a03e3c7be@googlegroups.com>
In reply to#11766
Hi, Ramazan.
Try this:

in the Close() method of your window:
local oBB as BoundingBox
oBB:=self:WindowArea // assuming SELF is your window

You may want to save oBB:Top, oBB:Left and so on values to the Registry, ini or a table.
While starting your program call SetWindowPos(...) with these values as params. In fact you need Top, Left, Width and Height params.
Z-order and flags may be used at your own will and need.
HTH  

[toc] | [prev] | [next] | [standalone]


#11773

FromRamazan <ryetisir@gmail.com>
Date2018-07-18 20:14 -0700
Message-ID<a7eaedbd-1e5d-4c37-b624-d4907480fe83@googlegroups.com>
In reply to#11771
On Thursday, 19 July 2018 00:25:10 UTC+3, Leo_Bond  wrote:
> Hi, Ramazan.
> Try this:
> 
> in the Close() method of your window:
> local oBB as BoundingBox
> oBB:=self:WindowArea // assuming SELF is your window
> 
> You may want to save oBB:Top, oBB:Left and so on values to the Registry, ini or a table.
> While starting your program call SetWindowPos(...) with these values as params. In fact you need Top, Left, Width and Height params.
> Z-order and flags may be used at your own will and need.
> HTH

It will be auto in this way, I'will try later on, thanks for sugestion.

Actually, belove code is working.

METHOD SaveScreenSizePos() CLASS SShellWindow 

   LOCAL lpRect is _winRECT 
   LOCAL wTop, wLeft as int 
   
   LOCAL sScrLeft   as STRING
   LOCAL sScrTop    as STRING
   LOCAL sScrWidth  as STRING
   LOCAL sScrHeight as STRING              
   
   LOCAL sTotStr as STRING
   LOCAL oASReg as Class_HKLM 
        
   oASReg := Class_HKLM{} 
   oASReg:Working_Subkey := "SOFTWARE\AgriSoft_Int\OK7Setings"   
   
   sScrWidth := NTrim(SysObject():Size:Width)  
   sScrHeight:= NTrim(SysObject():Size:Height) 
   
   GetWindowRect( SysObject():Handle(), @lpRect )   
   wTop  := Max( lpRect.top, 0 ) 
   wLeft := Max( lpRect.Left,0 )
   
   sScrTop := NTrim(wTop)  
   sScrLeft := NTrim(wLeft) 
   
   sTotStr := sScrLeft + "," + sScrTop + "," + sScrWidth + "," + sScrHeight       
   oASReg:WriteString( "", "OKScrPos", sTotStr )   

RETURN nil 
METHOD ReSetShellPosition() CLASS SShellWindow 
  
   LOCAL sSLeft   as STRING
   LOCAL sSTop    as STRING
   LOCAL sSWidth  as STRING
   LOCAL sSHeight as STRING              
   
   LOCAL sTotStr as STRING 
   LOCAL oASReg as Class_HKLM   
   
   oASReg := Class_HKLM{}  
   oASReg:Working_Subkey := "SOFTWARE\AgriSoft_Int\OK7Setings"
   sTotStr := oASReg:GetString( "", "OKScrPos" )     
                                                                
   IF !Empty( sTotStr )    
   	sSLeft := SubStr( sTotStr, 1, At(",", sTotStr) - 1 ) 
      ScrLeft := Val( sSLeft )
      sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1, -1 )
      
      sSTop   := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
      ScrTop  := Val( sSTop )
      sTotStr := SubStr(sTotStr, At( ",", sTotStr) + 1, -1 )
      
      sSWidth  := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
      ScrWidth := Val(sSWidth)
      sTotStr  := SubStr( sTotStr, At(",", sTotStr) + 1, -1 )  
         
      sSHeight  := sTotStr
      ScrHeight := Val( sSHeight )                
      
      SetWindowPos( self:Handle(), null_ptr, ScrLeft, ScrTop, ScrWidth, ScrHeight, SWP_SHOWWINDOW )
   ENDIF
   
RETURN nil 

[toc] | [prev] | [next] | [standalone]


#11775

FromJames Martin <james@northwoodlumber.com>
Date2018-07-19 10:37 -0400
Message-ID<piq7na$msg$1@dont-email.me>
In reply to#11773
I always saved my screen position and size in an ini file. That way if a 
person has 2 monitors, shuts down the the program on the added monitor, 
and tries to start the program when he has only one monitor, he can edit 
the ini file to start the program where he wants. This can happen when 
you use a laptop.

James

On 07/18/2018 11:14 PM, Ramazan wrote:
> On Thursday, 19 July 2018 00:25:10 UTC+3, Leo_Bond  wrote:
>> Hi, Ramazan.
>> Try this:
>>
>> in the Close() method of your window:
>> local oBB as BoundingBox
>> oBB:=self:WindowArea // assuming SELF is your window
>>
>> You may want to save oBB:Top, oBB:Left and so on values to the Registry, ini or a table.
>> While starting your program call SetWindowPos(...) with these values as params. In fact you need Top, Left, Width and Height params.
>> Z-order and flags may be used at your own will and need.
>> HTH
> 
> It will be auto in this way, I'will try later on, thanks for sugestion.
> 
> Actually, belove code is working.
> 
> METHOD SaveScreenSizePos() CLASS SShellWindow
> 
>     LOCAL lpRect is _winRECT
>     LOCAL wTop, wLeft as int
>     
>     LOCAL sScrLeft   as STRING
>     LOCAL sScrTop    as STRING
>     LOCAL sScrWidth  as STRING
>     LOCAL sScrHeight as STRING
>     
>     LOCAL sTotStr as STRING
>     LOCAL oASReg as Class_HKLM
>          
>     oASReg := Class_HKLM{}
>     oASReg:Working_Subkey := "SOFTWARE\AgriSoft_Int\OK7Setings"
>     
>     sScrWidth := NTrim(SysObject():Size:Width)
>     sScrHeight:= NTrim(SysObject():Size:Height)
>     
>     GetWindowRect( SysObject():Handle(), @lpRect )
>     wTop  := Max( lpRect.top, 0 )
>     wLeft := Max( lpRect.Left,0 )
>     
>     sScrTop := NTrim(wTop)
>     sScrLeft := NTrim(wLeft)
>     
>     sTotStr := sScrLeft + "," + sScrTop + "," + sScrWidth + "," + sScrHeight
>     oASReg:WriteString( "", "OKScrPos", sTotStr )
> 
> RETURN nil
> METHOD ReSetShellPosition() CLASS SShellWindow
>    
>     LOCAL sSLeft   as STRING
>     LOCAL sSTop    as STRING
>     LOCAL sSWidth  as STRING
>     LOCAL sSHeight as STRING
>     
>     LOCAL sTotStr as STRING
>     LOCAL oASReg as Class_HKLM
>     
>     oASReg := Class_HKLM{}
>     oASReg:Working_Subkey := "SOFTWARE\AgriSoft_Int\OK7Setings"
>     sTotStr := oASReg:GetString( "", "OKScrPos" )
>                                                                  
>     IF !Empty( sTotStr )
>     	sSLeft := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
>        ScrLeft := Val( sSLeft )
>        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1, -1 )
>        
>        sSTop   := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
>        ScrTop  := Val( sSTop )
>        sTotStr := SubStr(sTotStr, At( ",", sTotStr) + 1, -1 )
>        
>        sSWidth  := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
>        ScrWidth := Val(sSWidth)
>        sTotStr  := SubStr( sTotStr, At(",", sTotStr) + 1, -1 )
>           
>        sSHeight  := sTotStr
>        ScrHeight := Val( sSHeight )
>        
>        SetWindowPos( self:Handle(), null_ptr, ScrLeft, ScrTop, ScrWidth, ScrHeight, SWP_SHOWWINDOW )
>     ENDIF
>     
> RETURN nil
> 

[toc] | [prev] | [next] | [standalone]


#11776

FromJohnMartens <martens@tennishulp.info>
Date2018-07-19 17:01 +0200
Message-ID<piq94j$vo3$1@dont-email.me>
In reply to#11773
So is is fully working now ?

Op 19-7-2018 om 05:14 schreef Ramazan:
> On Thursday, 19 July 2018 00:25:10 UTC+3, Leo_Bond  wrote:
>> Hi, Ramazan.
>> Try this:
>>
>> in the Close() method of your window:
>> local oBB as BoundingBox
>> oBB:=self:WindowArea // assuming SELF is your window
>>
>> You may want to save oBB:Top, oBB:Left and so on values to the Registry, ini or a table.
>> While starting your program call SetWindowPos(...) with these values as params. In fact you need Top, Left, Width and Height params.
>> Z-order and flags may be used at your own will and need.
>> HTH
> 
> It will be auto in this way, I'will try later on, thanks for sugestion.
> 
> Actually, belove code is working.
> 
> METHOD SaveScreenSizePos() CLASS SShellWindow
> 
>     LOCAL lpRect is _winRECT
>     LOCAL wTop, wLeft as int
>     
>     LOCAL sScrLeft   as STRING
>     LOCAL sScrTop    as STRING
>     LOCAL sScrWidth  as STRING
>     LOCAL sScrHeight as STRING
>     
>     LOCAL sTotStr as STRING
>     LOCAL oASReg as Class_HKLM
>          
>     oASReg := Class_HKLM{}
>     oASReg:Working_Subkey := "SOFTWARE\AgriSoft_Int\OK7Setings"
>     
>     sScrWidth := NTrim(SysObject():Size:Width)
>     sScrHeight:= NTrim(SysObject():Size:Height)
>     
>     GetWindowRect( SysObject():Handle(), @lpRect )
>     wTop  := Max( lpRect.top, 0 )
>     wLeft := Max( lpRect.Left,0 )
>     
>     sScrTop := NTrim(wTop)
>     sScrLeft := NTrim(wLeft)
>     
>     sTotStr := sScrLeft + "," + sScrTop + "," + sScrWidth + "," + sScrHeight
>     oASReg:WriteString( "", "OKScrPos", sTotStr )
> 
> RETURN nil
> METHOD ReSetShellPosition() CLASS SShellWindow
>    
>     LOCAL sSLeft   as STRING
>     LOCAL sSTop    as STRING
>     LOCAL sSWidth  as STRING
>     LOCAL sSHeight as STRING
>     
>     LOCAL sTotStr as STRING
>     LOCAL oASReg as Class_HKLM
>     
>     oASReg := Class_HKLM{}
>     oASReg:Working_Subkey := "SOFTWARE\AgriSoft_Int\OK7Setings"
>     sTotStr := oASReg:GetString( "", "OKScrPos" )
>                                                                  
>     IF !Empty( sTotStr )
>     	sSLeft := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
>        ScrLeft := Val( sSLeft )
>        sTotStr := SubStr( sTotStr, At(",", sTotStr) + 1, -1 )
>        
>        sSTop   := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
>        ScrTop  := Val( sSTop )
>        sTotStr := SubStr(sTotStr, At( ",", sTotStr) + 1, -1 )
>        
>        sSWidth  := SubStr( sTotStr, 1, At(",", sTotStr) - 1 )
>        ScrWidth := Val(sSWidth)
>        sTotStr  := SubStr( sTotStr, At(",", sTotStr) + 1, -1 )
>           
>        sSHeight  := sTotStr
>        ScrHeight := Val( sSHeight )
>        
>        SetWindowPos( self:Handle(), null_ptr, ScrLeft, ScrTop, ScrWidth, ScrHeight, SWP_SHOWWINDOW )
>     ENDIF
>     
> RETURN nil
> 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web