NO

Author Topic: NEW addin : FullScreen  (Read 7757 times)

MaurizioF

  • Guest
NEW addin : FullScreen
« on: July 13, 2010, 06:01:54 PM »
This free AddIn allow you to maximize the edit area and work full screen
Just hit Escape to maximize /restore.
Enjoy
Maurizio.

CLR

  • Guest
Re: NEW addin : FullScreen
« Reply #1 on: July 14, 2010, 04:28:14 AM »
Thanks Maurizio very nice.

Offline lingo

  • Member
  • *
  • Posts: 27
Re: NEW addin : FullScreen
« Reply #2 on: July 14, 2010, 08:16:12 AM »
Yeah,

thanks a lot! That's a nice idea for poide.

But, try this:

- Load your project,
- Activate Your Add-In,
- Load fullscreen.c,
- Type ESC,
- Load fullscreen.rc,
- Close fullscreen.rc,

-> POIDE will crash,

and:
- It is not possible to activate it persistently,

and, as a hint:

- Attend, that there may be a standard key for this functionality - I think it's F11.

Nevertheless, thanks for Your contribution.

Grz
lingo



MaurizioF

  • Guest
Re: NEW addin : FullScreen
« Reply #3 on: July 14, 2010, 09:53:06 AM »
I cannot reproduce your problem.
do you mean :

start poide - it should be normal screen
activate my add.in (it should be already activated )
load my project (file/open/ fullscreen.ppj)
load fullscreen.c (you mean double click on fullscreen.c in the project window ?)
type ESC - now it should be fullscreen.
load fullscreen.rc (How ? do you resize the project window and double click on fullscreen.rc ?)
Close fullscreen.rc (right click on the tab and choose close ?)
I've done that and it works perfectly.

The only crash I've  experienced happens if you deactivate my add-in
when it's loaded.
I've just discovered it right now.
I'm going to investigate it.

it is not possible to activate it persistently

what do you mean ?
that if you exit from PoIde and then reenter you have to reactivate it manually ?
I had the same problem with several other add-ins
I think it's a PoIde problem.
It doesn't save the autoload flag in the registry
you can try to navigate, with regedit, to
HKEY_CURRENT_USER\Software\Pelle Orinius\PellesC\AddIns,
then to the right add-in
and modify manually the LoadOnStartup value from 0 to 1.

F11 key
I don't use the F11 because it's used by the debugger (step-into)

Regards
Maurizio


Offline lingo

  • Member
  • *
  • Posts: 27
Re: NEW addin : FullScreen
« Reply #4 on: July 14, 2010, 11:16:54 AM »
Hi Maurizio!

>I cannot reproduce your problem.
Sorry for that!

> type ESC - now it should be fullscreen.
Sorry, should be:
- Press ESC *twice*

>I've done that and it works perfectly.
If fullscreen Add-In is loaded, (my) poide crashes everytime
on closing a file tab, that was opened after loading the Add-In.
It seems that all file tabs opened before loading the Add-In,
will *not* crash on closing, but I doesn't check this exactly.

>it is not possible to activate it persistently
>what do you mean ?
>that if you exit from PoIde and then reenter you have to reactivate it manually ?
Yepp, that's right!

>you can try to navigate, with regedit, to
>HKEY_CURRENT_USER\Software\Pelle Orinius\PellesC\AddIns,
>then to the right add-in
>and modify manually the LoadOnStartup value from 0 to 1.
That works! But, as you say, poide now crashes on exit.

>F11 key
>I don't use the F11 because it's used by the debugger (step-into)
Maybe that's a problem.
Never mind! As said: was just a hint!

Lingo

MaurizioF

  • Guest
Re: NEW addin : FullScreen
« Reply #5 on: July 14, 2010, 12:13:38 PM »
Very strange.
Have you currently loaded others plug-ins beside mine ?
Maurizio.

Offline lingo

  • Member
  • *
  • Posts: 27
Re: NEW addin : FullScreen
« Reply #6 on: July 15, 2010, 07:45:01 AM »
Hi Maurizio,

>Have you currently loaded others plug-ins beside mine ?
of course, yes! Several.

After some tests yesterday evening, i identified, that Your
fullscreen seems not compatible with funclist:

http://www.smorgasbordet.com/pellesc/contrib_funclist.htm

But the saving problem of activation still exists.

HTH
Lingo
« Last Edit: July 15, 2010, 07:46:52 AM by lingo »

MaurizioF

  • Guest
Re: NEW addin : FullScreen
« Reply #7 on: July 15, 2010, 10:03:03 AM »
I think to have found the cause, but not the cure.
The trouble is caused by subclassing the main window.

When you click on the ok button in the plugin page
the ide tries to unload the addin (i suppose it calls FreeLibrary)

However, the subclassing is still active.
The command comes from windows, pass through my dll, goes to the original window proc that calls Freelibrary, as in the following schema :

click on the ok button
wm_command generated
wm_command sent to message loop
wm_command dispatched to my subclassing procedure
my subclassing procedure calls original proc (through CallWindowProc)
original proc calls Free_library
original proc return to CallWindowProc
CallWindowProc tries to return to my proc, but the dll does not exist anymore. Crash

And this probably explains also the lack of registration.

So unless Pelles does something about that,
it's impossible to subclass the main window. using normal c code.
(This could be done using some assembler magic, but this is too much for me)

So I must avoid to subclass the main window.
the only reason I did that was to process the WM_GETMINMAXINFO, to allow a bigger main window to cover the taskbar

Sigh.

Unless i find another way, we are restricted to see it.
I'm going to study about it.
Regards.
Maurizio.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: NEW addin : FullScreen
« Reply #8 on: July 15, 2010, 10:15:54 PM »
Project window option 'Snap to opposite side' leaves it visible.

BTW:
I can't see that WM_GETMINMAXINFO with MSGFILTER msg hook.
See example in an attachment.
« Last Edit: July 16, 2010, 07:48:08 AM by timovjl »
May the source be with you

MaurizioF

  • Guest
Re: NEW addin : FullScreen
« Reply #9 on: July 16, 2010, 09:26:02 AM »
1 ) I didn't notice the option "Snap to opposite side".
2) Very strange
I'll look at in in the weekend

Thanks
Maurizio


Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: NEW addin : FullScreen
« Reply #10 on: July 16, 2010, 01:21:13 PM »
Test program for that problem.
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

void MoveSplitters(HWND hWndIDE, HWND hWndMDI, int x1, int y1, int x2, int y2)
{
RECT rcMDI;
POINT pt;

GetWindowRect(hWndMDI, &rcMDI);
pt.x = rcMDI.left;
pt.y = rcMDI.bottom;
ScreenToClient(hWndIDE, &pt);
// Horizontal
PostMessage(hWndIDE, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(0, pt.y));
PostMessage(hWndIDE, WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(0, pt.y+10));
PostMessage(hWndIDE, WM_LBUTTONUP, MK_LBUTTON, MAKELONG(0, pt.y+10));
// Vertical
if (pt.x) { // left corner
PostMessage(hWndIDE, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(pt.x-2, pt.y));
PostMessage(hWndIDE, WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(pt.x-10, pt.y));
PostMessage(hWndIDE, WM_LBUTTONUP, MK_LBUTTON, MAKELONG(pt.x-10, pt.y));
} else { // right corner
pt.x = rcMDI.right;
pt.y = rcMDI.bottom;
ScreenToClient(hWndIDE, &pt);
PostMessage(hWndIDE, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(pt.x, pt.y));
PostMessage(hWndIDE, WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(pt.x+10, pt.y));
PostMessage(hWndIDE, WM_LBUTTONUP, MK_LBUTTON, MAKELONG(pt.x+10, pt.y));
}
}

int __cdecl WinMainCRTStartup(void)
{
HWND hWndIDE = FindWindowEx(0, NULL, "PellesC_IDE", NULL);
HWND hWndMDI = FindWindowEx(hWndIDE, NULL, "MDIClient", NULL);
MoveSplitters(hWndIDE, hWndMDI, 0, 0, 0, 0);
ExitProcess(0);
return 0;
}

And modified FullScreenX with just with menu without subclassing.

EDIT 20100816: FullScreenX_8.zip no CAPTION and hidden MENU toggles toolbar so quite 'full screen'
Menu must be there to avoid hanging when all documents are closed.

EDIT 20100817: FullScreenX_10.zip use esc-key for toggling
EDIT 20100818: FullScreenX_11.zip toggles statusbar too and not in right menu any more
« Last Edit: July 18, 2010, 10:43:29 AM by timovjl »
May the source be with you

MaurizioF

  • Guest
Re: NEW addin : FullScreen
« Reply #11 on: July 16, 2010, 02:16:33 PM »
Sure it works, but...
1) If you have more than one open document, you loose the tab bar
to switch from one source to the other.
2) you see the title and the menu bar
 I'd rather not to have them.
3) The window does not cover the task bar
4) I'd rather to have an hot key to switch between states
I choosed escape because if you hit F1 on a keyword,
the program switch to normal state (to allow the help window to popup)
the help windows appears
now if you hit esc twice:
the first key removes the help
the second, restores the fullscreen state.

I'm having some ideas to overcome the problems.
I'll work on it in the weekend.

Regards
maurizio


Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: NEW addin : FullScreen
« Reply #12 on: July 17, 2010, 02:29:58 PM »
esc-key works with latest test version.

http://forum.pellesc.de/index.php?topic=3232.msg12211#msg12211

2. menubar is almost hidden but i can be found with mouse.
4. change HWND_TOPMOST to HWND_TOP to get F1 working.
May the source be with you