Force a book to open in author mode and fullscreen

Share ideas and post helpful tips and solutions.

Force a book to open in author mode and fullscreen

Postby Clifton » Sat Apr 04, 2015 11:40 pm

Normally books opened from Windows Explorer will open in reader mode.
This is NOT the preferred behavior for DHTML deployment.
Therefore, how can you force books to open in author mode?
Simply copy the (openScript) code below and paste it into your book at book level:
Code: Select all
--CLIFTON: FORCES ALL BOOKS TO OPEN AND GO TO AUTHOR MODE
to handle enterApplication
   forward
   
   --ENABLE NEXT LINE TO DISABLE FORCING AUTHOR MODE AND MAXIMIZING WINDOW
   --break
   
   mySuspend of self = sysSuspend
   sysSuspend = false
   linkDLL32 "user32" --MAYBE GETS LINKED TWICE BUT THAT'S OKAY
      int UpdateWindow(DWORD)
      int RedrawWindow(DWORD, DWORD, DWORD, DWORD)
   end linkDLL32
   if sysLevel = "reader" then
      send author
   end if
   timerID of self = timerStart(single,300,500,self)
end enterApplication

to handle timerNotify timerID
   --CLIFTON: ADDED THIS TO SUPPORT ENTERBOOK HANDLER ABOVE
   sysSuspend = mySuspend of self
   clear mySuspend of self
   if timerID = timerID of self then
      clear timerID of self
      state of viewer id 0 of self = "maximized"
      get RedrawWindow(windowHandle32 of this window, 0, 0, 129)
   else
      forward
   end if
end timerNotify
--END OF MOFIFICATIONS BY CLIFTON

Note that using this code does not benefit or hinder the export process in any way. Using this completely optional, but I find it really useful to quickly open and get to work on a particular project. On the plus side, using this code WILL hide reader level errors related to PowerPac functions not working in reader mode.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron