Main Menu

Useful Bits

Started by WiiLF23, August 14, 2023, 12:16:46 AM

Previous topic - Next topic

WiiLF23

At a glance, this is what made things more streamlined for me.

Enable Visual Styles (Common-controls v6)

#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

Now your manifest will reflect this at compile-time.

Embedding Manifest - Project Settings > Macros > LINKFLAGS

-machine:x86 -subsystem:windows -safeseh /MANIFEST:EMBED kernel32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib advapi32.lib delayimp.lib

Update or replace your own LINKFLAGS to embed the manifest file at compile-time - /MANIFEST:EMBED
Rebuild project. Now you can delete the manifest file if you wish (recommended to retain file for development/learning).

Just a few things that helped me out on my 3rd day using this language and IDE. Cheers.

frankie

Hello WiiLF23
Welcome on board!  8)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

John Z

Hi WiiLF23

Welcome to the forum, nice tip.

There is another method I found to be easier.  Pelles C supports manifest as a resource.
Right click in the resource window and select NEW then manifest, then paste or type in the manifest instructions.
for example in my case paste:

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>
</assembly>



Now it is readily available to the program.  Someone here passed this on to me when I was struggling with getting
the new visual styles working using pragma.

John Z

Vortex

Hi WiiLF23,

Attached is a quick example for you. It displays a dialog box built with a manifest file, the resource script :

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 12.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1 MANIFEST "manifest.xml"

DLGTEMPLATE DIALOGEX DISCARDABLE 250, 100, 250, 102
STYLE WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_VISIBLE
CAPTION "Dialog box with manifest"
FONT 8, "MS Sans Serif", 0, 0, 1
{
  CONTROL "Test dialog", IDOK, "Static", SS_CENTER, 4, 12, 56, 12
}

Code it... That's all...

WiiLF23

Thank you everyone for your contributions!