i need an advicce >>>Control the Application Interface (1 Viewer)

kokowawa

Member
Local time
Today, 11:13
Joined
May 11, 2020
Messages
51
Hello @isladogs

in regards of your article "Control the Application Interface" placed in the below link .

http://www.mendipdatasystems.co.uk/control-application-interface/4594365418

i have tried to apply the SetAccessWindow (SW_HIDE) method in my app by Appling the code in the login form and then open the main menu form that have the main buttons of the app , it do hides the access window and hide ribbon and navigation pan , BUT , it dose NOT show any other form i try to open through the main menu , it do open the form but it is hidden somewhere , i dont know why .

when i use the code to show the access the window SetAccessWindow (SW_SHOW) , all the forms that i tried to open appear all together .

if i keep the access window shown , the forms open normal , but this is not i wanted to do , i want the window to be alwayes hidden while i use all forms

is there is a way to make the forms open normally while the access window still hidden?

if not is there is a code to resize the access window to the minimum size and center it in the middle of the screen?

i am trying all these methods to maximize the level of the security of the app that we have discussed earlier in the thread
https://www.access-programmers.co.u...etwork-challenge-please-how-to-secure.314250/

1603476769235.png
 

isladogs

CID VIP
Local time
Today, 09:13
Joined
Jan 14, 2017
Messages
14,268
I answered these questions in an earlier thread a week or so ago.
See https://www.access-programmers.co.uk/forums/threads/how-to-hide-the-main-acces-ui.308900/

Anyway, if you hide the application interface, you must use popup forms so these appear independently of the now hidden interface.
Also as in my app, the simplest code is to use the following line in your Form_Load event.
Code:
SetAccessWindow (SW_SHOWMINIMIZED)
Neither SW_HIDE nor SW_SHOW will give the desired result

That will make popup forms open 'normally' with the interface hidden BUT it has one big disadvantage.
If a user clicks the taskbar icon the app interface is restored.
To prevent that, use these three lines instead in Form_Load of each form used:
Code:
  SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW
    ShowWindow Application.hWndAccessApp, SW_HIDE
    ShowWindow Me.hWnd, SW_SHOW

Doing the above means there is no need to resize and maximise forms.
But in case you are interested, the app also includes my automatic form resizing code in modResizeForm.
That is triggered by using one line of code in Form_Load or Form_Open
Code:
ResizeForm Me

For a detailed explanation of automatic form resizing, see: http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784
Hope that answers your questions
 

kokowawa

Member
Local time
Today, 11:13
Joined
May 11, 2020
Messages
51
I answered these questions in an earlier thread a week or so ago.
See https://www.access-programmers.co.uk/forums/threads/how-to-hide-the-main-acces-ui.308900/

Anyway, if you hide the application interface, you must use popup forms so these appear independently of the now hidden interface.
Also as in my app, the simplest code is to use the following line in your Form_Load event.
Code:
SetAccessWindow (SW_SHOWMINIMIZED)
Neither SW_HIDE nor SW_SHOW will give the desired result

That will make popup forms open 'normally' with the interface hidden BUT it has one big disadvantage.
If a user clicks the taskbar icon the app interface is restored.
To prevent that, use these three lines instead in Form_Load of each form used:
Code:
  SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW
    ShowWindow Application.hWndAccessApp, SW_HIDE
    ShowWindow Me.hWnd, SW_SHOW

Doing the above means there is no need to resize and maximise forms.
But in case you are interested, the app also includes my automatic form resizing code in modResizeForm.
That is triggered by using one line of code in Form_Load or Form_Open
Code:
ResizeForm Me

For a detailed explanation of automatic form resizing, see: http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784
Hope that answers your questions


ooh , this is my bad i didnt make the proper search around the forum ,

i have red the mentioned post and downloaded the example , and try it , it give different response in each form , some forms open normal , some other forms open but hidden , some forms open normal but close the main menu form . what wrong did i do ?
i put the code on load in each form as u mentioned , but the results are different .

should i put SetAccessWindow (SW_SHOWMINIMIZED) in onLoad in each form too?


regarding modResizeForm i loved the mod specially that the app will run in different screen resolutions and what i was afraid off is the square screens , i have tested it in a form but didnt go well as expected , still checking what is wrong i did or what can i do with the code ,
please see example of screens with modResizeForm and without code.

first Pic without modResizeForm

1603489665583.png


second pic with cod modResizeForm which is too big ,maximized and not centered ( any advise before i look to the code )

1603489748409.png
 
Last edited:

isladogs

CID VIP
Local time
Today, 09:13
Joined
Jan 14, 2017
Messages
14,268
I strongly urge you to read the two articles on my website in full in order to understand how to use both of these features successfully

1. My example app at http://www.mendipdatasystems.co.uk/control-application-interface/4594365418 was designed to show how you can manage each part of the application interface as required in any app, switching items on/off as required. It is unlikely that any one app would ever need all of those features.

If you aren't worried about the application interface reappearing when users click the taskbar icon, then use this code in the Form_Load event of EVERY form
Code:
SetAccessWindow (SW_SHOWMINIMIZED)

However, as already stated, I now recommend that developers wishing to hide the application interface use this code in the Form_Load event of EVERY form
Code:
 SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW
    ShowWindow Application.hWndAccessApp, SW_HIDE
    ShowWindow Me.hWnd, SW_SHOW

The one exception is if you are using a split form in which case slightly different code is needed due to the 'special nature' of Access split forms. I will explain that later if relevant to you.

2. Automatic form resizing works well when the forms are designed to fit the screen in the lowest resolution that your users will have. If you don't take that into account when designing forms using AFR, you will end up with issues like those in your screenshot. This is explained in detail in my web article http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784

NOTE: I've just discovered my web server is currently down. Hopefully a temporary glitch. I'll follow up tomorrow morning if its still down
 

kokowawa

Member
Local time
Today, 11:13
Joined
May 11, 2020
Messages
51
I strongly urge you to read the two articles on my website in full in order to understand how to use both of these features successfully

1. My example app at http://www.mendipdatasystems.co.uk/control-application-interface/4594365418 was designed to show how you can manage each part of the application interface as required in any app, switching items on/off as required. It is unlikely that any one app would ever need all of those features.

If you aren't worried about the application interface reappearing when users click the taskbar icon, then use this code in the Form_Load event of EVERY form
Code:
SetAccessWindow (SW_SHOWMINIMIZED)

However, as already stated, I now recommend that developers wishing to hide the application interface use this code in the Form_Load event of EVERY form
Code:
 SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW
    ShowWindow Application.hWndAccessApp, SW_HIDE
    ShowWindow Me.hWnd, SW_SHOW

The one exception is if you are using a split form in which case slightly different code is needed due to the 'special nature' of Access split forms. I will explain that later if relevant to you.

2. Automatic form resizing works well when the forms are designed to fit the screen in the lowest resolution that your users will have. If you don't take that into account when designing forms using AFR, you will end up with issues like those in your screenshot. This is explained in detail in my web article http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784

NOTE: I've just discovered my web server is currently down. Hopefully a temporary glitch. I'll follow up tomorrow morning if its still down

yes you should urge to do read the thread , coz when i did read them it made a big difference to understand it , working on it and will try apply the steps on a new form and maybe decrease the resolution of the screen a little bit .
may i ask what AFR refers to as it is new for me ?

appreciate when you do the changes of the code for the split form .

the server was just fine and up when i looked to it.
 
Last edited:

isladogs

CID VIP
Local time
Today, 09:13
Joined
Jan 14, 2017
Messages
14,268
Thanks for the comments

AFR = automatic form resizing
Thankfully the web server was only down for a few hours
 

kokowawa

Member
Local time
Today, 11:13
Joined
May 11, 2020
Messages
51
UPDATE: i have removed any older code or modification in your code and put the code form_OnLoad and so far it worked fine with 15 forms . applying the code to the rest of forms and testing
thank you
 

Users who are viewing this thread

Top Bottom