Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Windows
»
How To: How to Invoke Default File Assocation Settings in Windows 10/11 [Solved]
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
NIL vs. Assign: when to u...
by
440bx
[
Today
at 01:08:36 am]
DuckHunter Game
by
Leledumbo
[March 24, 2025, 11:37:03 pm]
Rest API chunk file downl...
by
Leledumbo
[March 24, 2025, 11:34:01 pm]
Lazarus Instalation Error...
by
TRon
[March 24, 2025, 10:19:44 pm]
How to download/compile l...
by
Theo11
[March 24, 2025, 09:33:30 pm]
No fpc found on a fresh i...
by
cdbc
[March 24, 2025, 09:32:18 pm]
IDE tabs and spaces, auto...
by
Martin_fr
[March 24, 2025, 09:17:07 pm]
(Solved) Illegal paramete...
by
PascalDragon
[March 24, 2025, 09:03:12 pm]
MOVED: Trunk 3.3.1 access...
by
PascalDragon
[March 24, 2025, 08:58:18 pm]
Fast Fourier Transform (F...
by
tetrastes
[March 24, 2025, 08:51:53 pm]
Velthuis.Console.pas - Wo...
by
dculp
[March 24, 2025, 08:02:02 pm]
Test Regular Expressions
by
Gustavo 'Gus' Carreno
[March 24, 2025, 07:42:00 pm]
Drive a tank around the s...
by
TBMan
[March 24, 2025, 06:22:22 pm]
"database not open" - IBX...
by
rvk
[March 24, 2025, 05:55:32 pm]
GTK3 still alpha
by
han
[March 24, 2025, 05:46:27 pm]
mxMarkEdit as reference m...
by
maxnd
[March 24, 2025, 04:38:51 pm]
[Solved] How to get and u...
by
Hansaplast
[March 24, 2025, 04:19:31 pm]
lazarus-darwin-aarch64-3....
by
Jon Trepte
[March 24, 2025, 03:27:39 pm]
TlargeIntField set filt...
by
BrunoK
[March 24, 2025, 02:48:13 pm]
I'm wondering, what kind ...
by
Marc
[March 24, 2025, 02:21:46 pm]
Trunk 3.3.1 access violat...
by
Marc
[March 24, 2025, 02:16:02 pm]
TpageControl at design ti...
by
Paolo
[March 24, 2025, 01:28:25 pm]
Tcsvdataset issue
by
wp
[March 24, 2025, 01:04:24 pm]
TStringGrid AlternateC...
by
wp
[March 24, 2025, 12:57:04 pm]
About TFPExpressionParser
by
Zvoni
[March 24, 2025, 10:29:58 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: How To: How to Invoke Default File Assocation Settings in Windows 10/11 [Solved] (Read 941 times)
zxandris
Full Member
Posts: 152
How To: How to Invoke Default File Assocation Settings in Windows 10/11 [Solved]
«
on:
December 18, 2024, 05:28:26 pm »
Would anyone know how to invoke this?
I've seen it on some applications that are able to invoke the default "control panel" app for setting default apps for files. I was wondering if anyone knows how to do this.
Any help would be appreciated
CJ
«
Last Edit: December 18, 2024, 05:53:45 pm by zxandris
»
Logged
Fibonacci
Hero Member
Posts: 653
Internal Error Hunter
Re: How To: How to Invoke Default File Assocation Settings in Windows 10/11
«
Reply #1 on:
December 18, 2024, 05:39:29 pm »
Code: Pascal
[Select]
[+]
[-]
uses
Windows
;
procedure
OpenDefaultAppsSettings
;
begin
ShellExecute
(
0
,
'open'
,
'ms-settings:defaultapps'
,
nil
,
nil
,
SW_SHOWNORMAL
)
;
end
;
procedure
OpenWith
(
path
:
string
)
;
begin
ShellExecute
(
0
,
'open'
,
'rundll32.exe'
,
PChar
(
'shell32.dll,OpenAs_RunDLL '
+
path
)
,
nil
,
SW_SHOWNORMAL
)
;
end
;
begin
// default apps settings
OpenDefaultAppsSettings
;
// "open with..." dialog
OpenWith
(
'C:\yourfile.txt'
)
;
end
.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Windows
»
How To: How to Invoke Default File Assocation Settings in Windows 10/11 [Solved]
TinyPortal
© 2005-2018