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
Random Carpet Designs: La...
by
majolika
[
Today
at 03:47:06 pm]
Forum slow?
by
marcov
[
Today
at 03:42:03 pm]
how to use SetSysColors?
by
Zvoni
[
Today
at 03:41:35 pm]
Add Artificial Intelligen...
by
VisualLab
[
Today
at 03:23:30 pm]
Deal or no Deal graphic
by
TBMan
[
Today
at 02:57:28 pm]
Pac man and Missile Comma...
by
TBMan
[
Today
at 02:51:05 pm]
Bug and crash. I think th...
by
VisualLab
[
Today
at 02:51:00 pm]
A basic windows program s...
by
TRon
[
Today
at 02:36:43 pm]
Tesseract for ocr
by
rvk
[
Today
at 02:30:29 pm]
New Package to use WIA sc...
by
MaxM74
[
Today
at 01:25:49 pm]
Looking for better way...
by
alpine
[
Today
at 01:21:23 pm]
read text file position b...
by
Packs
[
Today
at 01:09:39 pm]
Context Sensitive Help fo...
by
marcov
[
Today
at 12:36:26 pm]
Troubles with function de...
by
alpine
[
Today
at 12:06:45 pm]
[Solved]Generic methods i...
by
cdbc
[
Today
at 11:47:01 am]
SplitString issue
by
Thaddy
[
Today
at 11:20:17 am]
changing the position of ...
by
kjteng
[
Today
at 10:48:10 am]
Usage of Lazlogger 2 - st...
by
PeterX
[
Today
at 10:08:04 am]
Generic function is 'wrea...
by
cdbc
[
Today
at 09:54:06 am]
Image processing
by
MarkMLl
[
Today
at 09:10:54 am]
show popupmenu in listvie...
by
ASerge
[
Today
at 06:19:40 am]
Accessing parent form fro...
by
nikel
[
Today
at 03:26:35 am]
fpspreadsheet (Spready) -...
by
tatamata
[
Today
at 01:34:00 am]
Crosshair following Point...
by
chucky
[February 11, 2025, 11:41:11 pm]
Custom self drawn compone...
by
VisualLab
[February 11, 2025, 11:18:35 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: How To: How to Invoke Default File Assocation Settings in Windows 10/11 [Solved] (Read 834 times)
zxandris
Full Member
Posts: 141
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: 650
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