Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add homepage/download/EnableGUI.hs for version control.

darcs-hash:20081113050124-c1071-0dd351662b9d4a37b464fbe1ef3171ef9c938533.gz
  • Loading branch information...
commit 49da325850b8af0f1084d778a5d8a6f80b84d7bc 1 parent 84c7f2a
@shelarcy shelarcy authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 homepage/download/EnableGUI.hs
View
20 homepage/download/EnableGUI.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+module EnableGUI(enableGUI) where
+
+import Data.Int
+import Foreign
+
+type ProcessSerialNumber = Int64
+
+foreign import ccall "GetCurrentProcess" getCurrentProcess :: Ptr ProcessSerialNumber -> IO Int16
+foreign import ccall "_CGSDefaultConnection" cgsDefaultConnection :: IO ()
+foreign import ccall "CPSEnableForegroundOperation" cpsEnableForegroundOperation :: Ptr ProcessSerialNumber -> IO ()
+foreign import ccall "CPSSignalAppReady" cpsSignalAppReady :: Ptr ProcessSerialNumber -> IO ()
+foreign import ccall "CPSSetFrontProcess" cpsSetFrontProcess :: Ptr ProcessSerialNumber -> IO ()
+
+enableGUI = alloca $ \psn -> do
+ getCurrentProcess psn
+ cgsDefaultConnection
+ cpsEnableForegroundOperation psn
+ cpsSignalAppReady psn
+ cpsSetFrontProcess psn
Please sign in to comment.
Something went wrong with that request. Please try again.