GetGUIType Function


The GetGUIType function returns the current GUI. You can test the return value of the function in an if statement or a switch statement. Use a switch statement when there are more than two logic branches.

If Statement Example

Suppose a feature is implemented differently in Windows, compared to all other platforms:

[-] if(GetGUIType() != msw)
	[ ] // test feature on all platforms but Windows
[-] else
	[ ] // test feature on Windows

Switch Statement Example

If your application is deployed on multiple platforms, and each platform implements the same feature slightly different, use the switch statement in a construction like the following:

[-] switch(GetGUIType())
	[-] case mswin7:
		[ ] // code to test feature on Windows 7
	[ ] 
	[-] case mswin2008r2 :
		[ ] // code to test feature on Windows 2008 R2