Jump to content

Ungroup Client on Taskbar


Recommended Posts

  • Honorable Member

Hello everyone.

 

If you play or played on gameforge servers you should to know that what is this.

When you are opening more than one clients the icon of the applications (on the windows taskbar) are groupped like 

Spoiler

22222510437e6a16.jpg.98c6885f4e30f36b3b9

With this little modification you can do like this(as on gameforge clients work):

Spoiler

222225043d75ec60.jpg.6c3e3b53a128595b9d1

 

 

Open the EterLib\MSWindow.cpp and paste this under the #include <windowsx.h> line:

#define DISABLE_TASKBAR_GROUPING
#ifdef DISABLE_TASKBAR_GROUPING
#include <Shobjidl.h>
#endif

Then scroll down to the CMSWindow::Create function and search this code:

	if (!m_hWnd)
		return false;

Paste the following code below of that:

#ifdef DISABLE_TASKBAR_GROUPING
	OSVERSIONINFO v;
	v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
	GetVersionEx(&v);
	if (v.dwMajorVersion == 6 && v.dwMinorVersion >= 1 || v.dwMajorVersion > 6)
	{
		WCHAR myAppID[128];
		swprintf(myAppID, sizeof(myAppID) / sizeof(myAppID[0]), L"MyMetin2AppID%u", GetCurrentProcessId());
		HRESULT hr = SetCurrentProcessExplicitAppUserModelID(myAppID);
		if (!SUCCEEDED(hr))
			return false;
	}
#endif

 

The if-statement checks your windows version and if passed, the ungrouping will run. (6.1 is Win7SP1)

P3NG3R

  • Love 1
  • Love 18
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • Active Member

Good job but have a little problem about "SetCurrentProcessExplicitAppUserModelID" usage API works on Win7 or later, You already do requirement with GetVersionEx but it is not enough because you are already used "SetCurrentProcessExplicitAppUserModelID" in your client and builded IAT with this API so when XP or Vista users try run your client he will get this error.

Spoiler

sdds.png

You need call as dynamic, like this;

    OSVERSIONINFO v;
    v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    GetVersionEx(&v);
    
    if (v.dwMajorVersion >= 6 && v.dwMinorVersion >= 1)
    {
        WCHAR myAppID[128];
        swprintf(myAppID, sizeof(myAppID) / sizeof(myAppID[0]), L"MyMetin2AppID%u", GetCurrentProcessId());
        
        typedef HRESULT(WINAPI* SetCurrentProcessExplicitAppUserModelIDptr)(_In_ PCWSTR AppID);
        SetCurrentProcessExplicitAppUserModelIDptr SetCurrentProcessExplicitAppUserModelIDo = (SetCurrentProcessExplicitAppUserModelIDptr)GetProcAddress(LoadLibraryA("shell32.dll"), "SetCurrentProcessExplicitAppUserModelID");
        if (SetCurrentProcessExplicitAppUserModelIDo)

        {
            HRESULT hr = SetCurrentProcessExplicitAppUserModelIDo(myAppID);
            if (!SUCCEEDED(hr))
                return false;
        }
    }

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 3
Link to comment
Share on other sites

  • Honorable Member

My friend, Void tried to say that, the prior operationg systems are out of date to use in this decade, and don't need solution to work on those systems, I think.

ofc yr code isn't bad, but nowaday who want to use XP or S: vista :S damn oh god pls :ph34r:

Link to comment
Share on other sites

  • Honorable Member
14 minutes ago, xP3NG3Rx said:

nowaday who want to use XP or S: vista :S damn oh god pls :ph34r:

Only a relevant % of turkish people use XP nowadays. (so, in that case, it's crucial)

Vista users can't even boot windows without getting 2-3 BSOD, so they are not a problem.

  • Lmao 1
Link to comment
Share on other sites

güzel mevzuyu anlamayan arkadaşlar şöyle anlatabilirim.

araç çubuğunuzda minimize yani küçült(aşağı al) butonuna aldığınızdada

aynı oyundan iki tane client çalışıyorsa ayrı ayrı gösteriyor zaten gereksiz

You Lose :)

4b70c3f52b944d528ef99711959f653c.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.