LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make API call to freeze excel window?


Hi,

Does anyone know how to freeze the active window using windows API?

I tried this:

Class named FreezeWindow:

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal ClassName As String, ByVal WindowName As String) As Long

Private Declare Function LockWindowUpdate Lib "user32" _
(ByVal hWndLock As Long) As Long


Public Sub Freeze(Window As Window)

Dim hWnd As Long

hWnd = FindWindow("XLMAIN", Application.Caption)

End Sub

Public Sub Unfreeze()

LockWindowUpdate 0

End Sub

Private Sub Class_Terminate()

Unfreeze

End Sub

and in the macro:

dim FreezeWnd as New FreezeWindow

FreezeWnd.Freeze ActiveWindow

FreezeWnd.Unfreeze


I can't get it to work, don't know what's wrong (still learning VBA).

Thanks in advance
Mik

--
Mikeyhen
-----------------------------------------------------------------------
Mikeyhend's Profile: http://www.excelforum.com/member.php...fo&userid=3340
View this thread: http://www.excelforum.com/showthread.php?threadid=56442

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I freeze/ unfreeze a window pane in Excel 2007? Bombarded_avec_change Excel Discussion (Misc queries) 2 July 7th 09 08:12 PM
view excel worksheet & freeze internet window synchronously John H. Herrlinger Excel Worksheet Functions 0 April 26th 09 11:14 AM
Window Tool Bar - Freeze pane does not appear dford Excel Discussion (Misc queries) 2 July 20th 07 04:46 AM
Excel: find Window in which I can freeze panes 4most New Users to Excel 3 July 8th 06 10:55 PM
Excel should allow me to freeze pane in a split window MGB Excel Worksheet Functions 1 March 29th 05 05:50 PM


All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"